Don't allow custom font upload

Extraction of the font from POST seems buggy and causes other problems
main
Bob Mottram 2020-05-27 16:08:09 +01:00
parent da148f8e9e
commit c740b07c9f
2 changed files with 7 additions and 8 deletions

View File

@ -5419,8 +5419,7 @@ class PubServer(BaseHTTPRequestHandler):
# extract each image type # extract each image type
actorChanged = True actorChanged = True
profileMediaTypes = ('avatar', 'image', profileMediaTypes = ('avatar', 'image',
'banner', 'instanceLogo', 'banner', 'instanceLogo')
'customFont')
profileMediaTypesUploaded = {} profileMediaTypesUploaded = {}
for mType in profileMediaTypes: for mType in profileMediaTypes:
if self.server.debug: if self.server.debug:

View File

@ -1167,12 +1167,12 @@ def htmlEditProfile(translate: {}, baseDir: str, path: str,
themesDropdown += ' <option value="highvis">' + \ themesDropdown += ' <option value="highvis">' + \
translate['HighVis'] + '</option>' translate['HighVis'] + '</option>'
themesDropdown += ' </select><br>' themesDropdown += ' </select><br>'
themesDropdown += \ # themesDropdown += \
' <label class="labels">' + \ # ' <label class="labels">' + \
translate['Custom Font'] + '</label>' # translate['Custom Font'] + '</label>'
themesDropdown += \ # themesDropdown += \
' <input type="file" id="customFont" name="customFont"' # ' <input type="file" id="customFont" name="customFont"'
themesDropdown += ' accept="' + fontFormats + '">' # themesDropdown += ' accept="' + fontFormats + '">'
if os.path.isfile(baseDir + '/fonts/custom.woff') or \ if os.path.isfile(baseDir + '/fonts/custom.woff') or \
os.path.isfile(baseDir + '/fonts/custom.woff2') or \ os.path.isfile(baseDir + '/fonts/custom.woff2') or \
os.path.isfile(baseDir + '/fonts/custom.otf') or \ os.path.isfile(baseDir + '/fonts/custom.otf') or \