Escape non printing ascii character

pull/123/head
Erik Johnston 2015-03-24 16:31:52 +00:00
parent f488293d96
commit 0ba393924a
1 changed files with 3 additions and 3 deletions

View File

@ -102,10 +102,10 @@ class RoomStore(SQLBaseStore):
"ON c.event_id = room_names.event_id " "ON c.event_id = room_names.event_id "
) )
# We use non printing ascii character US () as a seperator # We use non printing ascii character US (\x1F) as a separator
sql = ( sql = (
"SELECT r.room_id, n.name, t.topic, " "SELECT r.room_id, n.name, t.topic, "
"group_concat(a.room_alias, '') " "group_concat(a.room_alias, '\x1F') "
"FROM rooms AS r " "FROM rooms AS r "
"LEFT JOIN (%(topic)s) AS t ON t.room_id = r.room_id " "LEFT JOIN (%(topic)s) AS t ON t.room_id = r.room_id "
"LEFT JOIN (%(name)s) AS n ON n.room_id = r.room_id " "LEFT JOIN (%(name)s) AS n ON n.room_id = r.room_id "
@ -130,7 +130,7 @@ class RoomStore(SQLBaseStore):
"room_id": r[0], "room_id": r[0],
"name": r[1], "name": r[1],
"topic": r[2], "topic": r[2],
"aliases": r[3].split(""), "aliases": r[3].split("\x1F"),
} }
for r in rows for r in rows
] ]