mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°1910 - iTop - Search on Text contains "_" not working - move correction in other place
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -568,7 +568,6 @@ 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
|
||||
@@ -600,7 +599,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');
|
||||
|
||||
Reference in New Issue
Block a user