diff --git a/pages/UI.php b/pages/UI.php index a6f76a329..7bf8491e8 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -564,7 +564,7 @@ try $sFullText = trim($aMatches[2]); } } - + $sFullText = str_replace('_', '\_', $sFullText); if (preg_match('/^"(.*)"$/', $sFullText, $aMatches)) { // The text is surrounded by double-quotes, remove the quotes and treat it as one single expression @@ -596,7 +596,7 @@ try break; } $sFullText = implode(' ', $aFullTextNeedles); - + $sFullText = str_replace('\_', '_', $sFullText); // Sanity check of the accelerators /** @var array $aAccelerators */ $aAccelerators = MetaModel::GetConfig()->Get('full_text_accelerators'); diff --git a/sources/application/search/criterionconversion/criteriontooql.class.inc.php b/sources/application/search/criterionconversion/criteriontooql.class.inc.php index 0c70778d2..cc90ae6f8 100644 --- a/sources/application/search/criterionconversion/criteriontooql.class.inc.php +++ b/sources/application/search/criterionconversion/criteriontooql.class.inc.php @@ -123,6 +123,7 @@ class CriterionToOQL extends CriterionConversionAbstract { return "1"; } + $sValue = str_replace('_', '\_', $sValue); return "({$sRef} LIKE '%{$sValue}%')"; }