diff --git a/shares.py b/shares.py index bde0203e1..5e7b51aaf 100644 --- a/shares.py +++ b/shares.py @@ -83,7 +83,7 @@ def getValidSharedItemID(actor: str, displayName: str) -> str: """Removes any invalid characters from the display name to produce an item ID """ - removeChars = (' ', '\n', '\r') + removeChars = (' ', '\n', '\r', '#') for ch in removeChars: displayName = displayName.replace(ch, '') removeChars2 = ('+', '/', '\\', '?', '&') @@ -91,7 +91,7 @@ def getValidSharedItemID(actor: str, displayName: str) -> str: displayName = displayName.replace(ch, '-') displayName = displayName.replace('.', '_') displayName = displayName.replace("’", "'") - return actor + '/shareditems/' + displayName + return actor.replace('/', '#') + '#shareditems#' + displayName def removeSharedItem(baseDir: str, nickname: str, domain: str, diff --git a/webapp_utils.py b/webapp_utils.py index 6699c0201..c001cb3ca 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -381,7 +381,8 @@ def sharesTimelineJson(actor: str, pageNumber: int, itemsPerPage: int, ctr = 0 for itemID, item in sharesJson.items(): # assign owner to the item - item['actor'] = itemID.split('/shareditems/')[0] + item['actor'] = \ + itemID.split('#shareditems#')[0].replace('#', '/') allSharesJson[str(item['published'])] = item ctr += 1 if ctr >= maxSharesPerAccount: