N°1910 - iTop - Search on Text contains "_" not working - move correction in other place

This commit is contained in:
acognet
2020-05-12 14:47:41 +02:00
parent a81950571a
commit 873d109b98
2 changed files with 5 additions and 3 deletions

View File

@@ -632,7 +632,10 @@ class DBObjectSearch extends DBSearch
$oNewCond = new BinaryExpression($oTextFields, 'LIKE', $oFlexNeedle);
$this->AddConditionExpression($oNewCond);
$this->m_aParams[$sQueryParam] = $sNeedle;
//replace in order to search the character "_" ("_" in mysql is like "%" for only one character).
$sFullText = str_replace('_', '\_', $sNeedle);
$this->m_aParams[$sQueryParam] = $sFullText;
}
protected function AddToNameSpace(&$aClassAliases, &$aAliasTranslation, $bTranslateMainAlias = true)