[TYPO3-core] RFC: fix bug #990

Holzinger Franz franz at fholzinger.com
Wed Jan 4 12:53:44 CET 2006


Hello Martin,

>@@ -6342,7 +6344,7 @@
> 				if (strlen($val)>=2)	{
> 					reset($searchFields);
> 					while(list(,$field)=each($searchFields))	{
>-						$where_p[] = $prefixTableName.$field.' LIKE \'%'.$GLOBALS['TYPO3_DB']->quoteStr($val, $searchTable).'%\'';
>+						$where_p[] = $prefixTableName.$field.' LIKE \'%'.$TYPO3_DB->escapeStrForLike($TYPO3_DB->quoteStr($val, $searchTable)).'%\'';
> 					}
> 				}
> 				if (count($where_p))	{
>  
>
You are calling the

>$TYPO3_DB->escapeStrForLike($TYPO3_DB->quoteStr($val, $searchTable))
>
in a loop, which is not necessary here.

Call it right after the
$val = trim($val);
only once.


Greets,

Franz





More information about the TYPO3-team-core mailing list