Fix the allowed range of valid ordering characters for spaces. (#10002)

\x7F was meant to be \0x7E (~) this was originally incorrect
in MSC1772.
pull/10009/head
Patrick Cloke 2021-05-17 09:59:17 -04:00 committed by GitHub
parent 9752849e2b
commit 206a7b5f12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

1
changelog.d/10002.bugfix Normal file
View File

@ -0,0 +1 @@
Fix a validation bug introduced in v1.34.0 in the ordering of spaces in the space summary API.

View File

@ -471,8 +471,8 @@ def _is_suggested_child_event(edge_event: EventBase) -> bool:
return False
# Order may only contain characters in the range of \x20 (space) to \x7F (~).
_INVALID_ORDER_CHARS_RE = re.compile(r"[^\x20-\x7F]")
# Order may only contain characters in the range of \x20 (space) to \x7E (~) inclusive.
_INVALID_ORDER_CHARS_RE = re.compile(r"[^\x20-\x7E]")
def _child_events_comparison_key(child: EventBase) -> Tuple[bool, Optional[str], str]: