mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-12 22:23:02 -04:00
Discard null-containing strings before updating the user directory (#12762)
This commit is contained in:
parent
8afb7b55d0
commit
d4713d3e33
6 changed files with 45 additions and 11 deletions
|
@ -52,6 +52,7 @@ from synapse.storage.util.sequence import SequenceGenerator
|
|||
from synapse.types import JsonDict, StateMap, get_domain_from_id
|
||||
from synapse.util import json_encoder
|
||||
from synapse.util.iterutils import batch_iter, sorted_topologically
|
||||
from synapse.util.stringutils import non_null_str_or_none
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from synapse.server import HomeServer
|
||||
|
@ -1728,9 +1729,6 @@ class PersistEventsStore:
|
|||
not affect the current local state.
|
||||
"""
|
||||
|
||||
def non_null_str_or_none(val: Any) -> Optional[str]:
|
||||
return val if isinstance(val, str) and "\u0000" not in val else None
|
||||
|
||||
self.db_pool.simple_insert_many_txn(
|
||||
txn,
|
||||
table="room_memberships",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue