change regex for name-searching to match synapse behaviour
This commit is contained in:
@@ -281,12 +281,12 @@ class mxDatabase
|
||||
$term = filter_var($search_term, FILTER_SANITIZE_STRING);
|
||||
$result = array();
|
||||
$sql = "SELECT COUNT(*) FROM logins WHERE"
|
||||
. " localpart LIKE '%" . $term . "%';";
|
||||
. " localpart LIKE '" . $term . "%';";
|
||||
$res = $this->db->query($sql);
|
||||
|
||||
if ($res->fetchColumn() > 0) {
|
||||
$sql = "SELECT first_name, last_name, localpart FROM logins WHERE"
|
||||
. " localpart LIKE '%" . $term . "%';";
|
||||
. " localpart LIKE '" . $term . "%';";
|
||||
foreach ($this->db->query($sql) as $row) {
|
||||
array_push($result, [
|
||||
"display_name" => $row["first_name"] . " " . $row["last_name"],
|
||||
|
||||
Reference in New Issue
Block a user