Commit e0e29ebe authored by Evan Goldenberg's avatar Evan Goldenberg
Browse files

explicitly cast text to integer to prevent postgres errors


Signed-off-by: default avatarEvan Goldenberg <evang@catalyst.net.nz>
parent 8c5a6fdd
...@@ -107,7 +107,7 @@ class PluginSearchInternal extends PluginSearch { ...@@ -107,7 +107,7 @@ class PluginSearchInternal extends PluginSearch {
$querydata = split(' ', preg_replace('/\s\s+/', ' ', strtolower(trim($query_string)))); $querydata = split(' ', preg_replace('/\s\s+/', ' ', strtolower(trim($query_string))));
$hidenameallowed = get_config('userscanhiderealnames') ? 'TRUE' : 'FALSE'; $hidenameallowed = get_config('userscanhiderealnames') ? 'TRUE' : 'FALSE';
$namesql = "(u.preferredname $ilike '%' || ? || '%') $namesql = "(u.preferredname $ilike '%' || ? || '%')
OR ((u.preferredname IS NULL OR u.preferredname = '' OR NOT $hidenameallowed OR h.value <> 1) OR ((u.preferredname IS NULL OR u.preferredname = '' OR NOT $hidenameallowed OR h.value::integer <> 1)
AND (u.firstname $ilike '%' || ? || '%' OR u.lastname $ilike '%' || ? || '%')) AND (u.firstname $ilike '%' || ? || '%' OR u.lastname $ilike '%' || ? || '%'))
OR (a.artefacttype IN $fieldlist OR (a.artefacttype IN $fieldlist
AND ( a.title $ilike '%' || ? || '%'))"; AND ( a.title $ilike '%' || ? || '%'))";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment