Get page number

master
Bob Mottram 2019-09-04 12:42:22 +01:00
parent 320d489f4f
commit eaf4513e64
1 changed files with 8 additions and 6 deletions

View File

@ -1967,7 +1967,14 @@ class PubServer(BaseHTTPRequestHandler):
# -1 = new post failed # -1 = new post failed
# 2 = new post canceled # 2 = new post canceled
pageNumber=1 pageNumber=1
if authorized and '/users/' in self.path and self.path.endswith('?'+postType): if authorized and '/users/' in self.path and '?'+postType+'?' in self.path:
if '?page=' in in self.path:
pageNumberStr=self.path.split('?page=')[1]
if '?' in pageNumberStr:
pageNumberStr=pageNumberStr.split('?')[0]
if pageNumberStr.isdigit():
pageNumber=int(pageNumberStr)
self.path=self.path.split('?page=')[0]
if ' boundary=' in self.headers['Content-type']: if ' boundary=' in self.headers['Content-type']:
nickname=None nickname=None
nicknameStr=self.path.split('/users/')[1] nicknameStr=self.path.split('/users/')[1]
@ -2058,11 +2065,6 @@ class PubServer(BaseHTTPRequestHandler):
else: else:
filename=None filename=None
# get the page number to return to
if fields.get('pageNumber'):
if fields['pageNumber'].isdigit():
pageNumber=int(fields['pageNumber'])
# send the post # send the post
if not fields.get('message'): if not fields.get('message'):
return -1,pageNumber return -1,pageNumber