[TYPO3-core] RFC: Bug #9442: SQL LIKE wildcards are not escaped correctly for list queries

Martin Kutschker masi-no at spam-typo3.org
Mon Sep 29 09:08:54 CEST 2008


Oliver Hader schrieb:
> This is a SVN patch request.
> 
> Problem:
> Using t3lib_db::listQuery('some_Tag') - and knowing that "_" and "%" are
> wildcard characters in SQL LIKE statements - will produce wrong result sets.
> 
> Solution:
> Escape "%" and "_" correctly when they are used in a LIKE statement.

What is the difference between the old and the new version? Th old one
uses one assignement less. Both use a variation of "command" (which it
isn't) and both have a superfluos comparisons: % is like * (none or any)
not like + (any, but at least one).

http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html#operator_like

Masi

PS: Fetching some coffee...


More information about the TYPO3-team-core mailing list