mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 00:04:27 +02:00
Added casts to binary for regexp comparison in mysql. mysql rejects comparison of UTF with binary strings.
see https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-22.html#mysqld-8-0-22-feature The SQL statements also work for mariadb.
This commit is contained in:
parent
8e0a3d00bb
commit
6e84c0ade7
3 changed files with 9 additions and 7 deletions
|
@ -254,7 +254,9 @@ class Contact extends BaseModule
|
|||
$searching = true;
|
||||
$search_hdr = $search;
|
||||
$search_txt = preg_quote(trim($search, ' @!'));
|
||||
$sql_extra .= " AND (`name` REGEXP ? OR `url` REGEXP ? OR `nick` REGEXP ? OR `addr` REGEXP ? OR `alias` REGEXP ?)";
|
||||
$sql_extra .= " AND (CAST(`name` AS BINARY) REGEXP BINARY ? OR CAST(`url` AS BINARY) REGEXP BINARY ?";
|
||||
$sql_extra .= " OR CAST(`nick` AS BINARY) REGEXP BINARY ? OR CAST(`addr` AS BINARY) REGEXP BINARY ?";
|
||||
$sql_extra .= " OR CAST(`alias` AS BINARY) REGEXP BINARY ?)";
|
||||
$sql_values[] = $search_txt;
|
||||
$sql_values[] = $search_txt;
|
||||
$sql_values[] = $search_txt;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue