diff options
author | Richard van der Hoff <github@rvanderhoff.org.uk> | 2017-10-03 13:49:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-03 13:49:05 +0100 |
commit | e4779be97ac3e9b6cc8ac88f891d1a48c1dc5de4 (patch) | |
tree | de2d4759676ef7a1e5495b484cf75437f2031b89 /scripts/synapse_port_db | |
parent | Merge branch 'master' of github.com:matrix-org/synapse into develop (diff) | |
parent | Drop search values with nul characters (diff) | |
download | synapse-e4779be97ac3e9b6cc8ac88f891d1a48c1dc5de4.tar.xz |
Merge pull request #2491 from matrix-org/rav/port_db_fixes
Drop search values with nul characters
Diffstat (limited to 'scripts/synapse_port_db')
-rwxr-xr-x | scripts/synapse_port_db | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/synapse_port_db b/scripts/synapse_port_db index bc167b59af..dc7fe940e8 100755 --- a/scripts/synapse_port_db +++ b/scripts/synapse_port_db @@ -376,10 +376,13 @@ class Porter(object): " VALUES (?,?,?,?,to_tsvector('english', ?),?,?)" ) - rows_dict = [ - dict(zip(headers, row)) - for row in rows - ] + rows_dict = [] + for row in rows: + d = dict(zip(headers, row)) + if "\0" in d['value']: + logger.warn('dropping search row %s', d) + else: + rows_dict.append(d) txn.executemany(sql, [ ( |