mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°1910 - iTop - Search on Text contains "_" not working
_ is a special caracter in mysql -> replace with \_
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -123,6 +123,7 @@ class CriterionToOQL extends CriterionConversionAbstract
|
||||
{
|
||||
return "1";
|
||||
}
|
||||
$sValue = str_replace('_', '\_', $sValue);
|
||||
|
||||
return "({$sRef} LIKE '%{$sValue}%')";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user