Replacing colon

merge-requests/30/head
Bob Mottram 2021-07-27 20:48:31 +01:00
parent f9012cd948
commit 4f58cc98c1
3 changed files with 5 additions and 3 deletions

View File

@ -10230,8 +10230,7 @@ class PubServer(BaseHTTPRequestHandler):
return True
mediaStr = path.split('/sharefiles/')[1]
mediaFilename = \
baseDir + '/sharefiles/' + mediaStr
mediaFilename = baseDir + '/sharefiles/' + mediaStr
if not os.path.isfile(mediaFilename):
self._404()
return True

View File

@ -91,7 +91,9 @@ def getValidSharedItemID(actor: str, displayName: str) -> str:
displayName = displayName.replace(ch, '-')
displayName = displayName.replace('.', '_')
displayName = displayName.replace("", "'")
return actor.replace('/', '#') + '#shareditems#' + displayName
actor = actor.replace('://', '--##')
actor = actor.replace('/', '#')
return actor + '#shareditems#' + displayName
def removeSharedItem(baseDir: str, nickname: str, domain: str,

View File

@ -384,6 +384,7 @@ def sharesTimelineJson(actor: str, pageNumber: int, itemsPerPage: int,
shareActor = ''
if '#shareditems#' in itemID:
shareActor = itemID.split('#shareditems#')[0]
shareActor = shareActor.replace('--##', '://')
shareActor = shareActor.replace('#', '/')
item['actor'] = shareActor
allSharesJson[str(item['published'])] = item