mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
7dd906da58
commit
fe99792df9
21
person.py
21
person.py
|
@ -1427,19 +1427,18 @@ def getPersonAvatarUrl(baseDir: str, personUrl: str, personCache: {},
|
|||
|
||||
imageExtension = getImageExtensions()
|
||||
for ext in imageExtension:
|
||||
if os.path.isfile(avatarImagePath + '.' + ext):
|
||||
imFilename = avatarImagePath + '.' + ext
|
||||
imPath = '/avatars/' + actorStr + '.' + ext
|
||||
if not os.path.isfile(imFilename):
|
||||
imFilename = avatarImagePath.lower() + '.' + ext
|
||||
imPath = '/avatars/' + actorStr.lower() + '.' + ext
|
||||
if not os.path.isfile(imFilename):
|
||||
continue
|
||||
if ext == 'svg':
|
||||
if not dangerousSVG(avatarImagePath + '.' + ext, False):
|
||||
return '/avatars/' + actorStr + '.' + ext
|
||||
if not dangerousSVG(imFilename, False):
|
||||
return imPath
|
||||
else:
|
||||
return '/avatars/' + actorStr + '.' + ext
|
||||
elif os.path.isfile(avatarImagePath.lower() + '.' + ext):
|
||||
if ext == 'svg':
|
||||
if not dangerousSVG(avatarImagePath.lower() + '.' + ext,
|
||||
False):
|
||||
return '/avatars/' + actorStr.lower() + '.' + ext
|
||||
else:
|
||||
return '/avatars/' + actorStr.lower() + '.' + ext
|
||||
return imPath
|
||||
|
||||
if personJson.get('icon'):
|
||||
if personJson['icon'].get('url'):
|
||||
|
|
Loading…
Reference in New Issue