summary refs log tree commit diff
path: root/synapse/handlers/profile.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-10-20 17:42:37 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2020-10-20 17:42:37 +0100
commit2bd022e04c6c1a82a73376db8999db0b29ed6cfc (patch)
tree434dede692ea9b7f2474993f386b8801f62ba010 /synapse/handlers/profile.py
parentMerge commit '54f8d73c0' into anoa/dinsic_release_1_21_x (diff)
parentMake _get_e2e_device_keys_and_signatures_txn return an attrs (#8224) (diff)
downloadsynapse-2bd022e04c6c1a82a73376db8999db0b29ed6cfc.tar.xz
Merge commit 'abeab964d' into anoa/dinsic_release_1_21_x
* commit 'abeab964d':
  Make _get_e2e_device_keys_and_signatures_txn return an attrs (#8224)
  Fix errors when updating the user directory with invalid data (#8223)
  Explain better what GDPR-erased means (#8189)
  Convert additional databases to async/await part 3 (#8201)
  Convert appservice code to async/await. (#8207)
  Rename `_get_e2e_device_keys_txn` (#8222)
Diffstat (limited to 'synapse/handlers/profile.py')
-rw-r--r--synapse/handlers/profile.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py

index adb9dc7c42..5c9579394c 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py
@@ -262,6 +262,9 @@ class BaseProfileHandler(BaseHandler): Codes.FORBIDDEN, ) + if not isinstance(new_displayname, str): + raise SynapseError(400, "Invalid displayname") + if len(new_displayname) > MAX_DISPLAYNAME_LEN: raise SynapseError( 400, "Displayname is too long (max %i)" % (MAX_DISPLAYNAME_LEN,) @@ -386,6 +389,9 @@ class BaseProfileHandler(BaseHandler): 400, "Changing avatar is disabled on this server", Codes.FORBIDDEN ) + if not isinstance(new_avatar_url, str): + raise SynapseError(400, "Invalid displayname") + if len(new_avatar_url) > MAX_AVATAR_URL_LEN: raise SynapseError( 400, "Avatar URL is too long (max %i)" % (MAX_AVATAR_URL_LEN,)