Bug #23103
closedIt is not possible to search for '%' or '_' inside the Backend
100%
Description
Neither with the search-button in the Backend-Toolbar, nor within the Admin-Tool 'DB check' with the 'full search' function, it is possible to search for the chars '%' and '_'.
Both functions does not escape the named chars for using inside the like-query, so they are interpreted as wildcards by sql.
Additionally the Toolbar-search does not use the function t3lib_db->searchQuery, which should be used for dbal support.
Solution:
adding t3lib_db->escapeStrForLike into t3lib_db->searchQuery
using t3lib_db->searchQuery inside the Toolbar-search (class.db_list.inc)
see patch
(issue imported from #M15001)
Files
Updated by Xavier Perseguers over 14 years ago
Just uploaded 15001_core_v3.diff (from mailing list) and a new version of DBAL's patch (15001_dbal_v4.diff) which does not exist in ML but works at least with unit tests. Will have to test it on real DBMS.
Updated by Caspar Stuebs over 14 years ago
Uploaded a new version of DBAL's patch (15001_dbal_v5.diff)
searchQuery() should only add the ' OR ' to the query, if both parts contains data, not only the first one...
Updated by Xavier Perseguers over 14 years ago
Hi,
Thanks for the patch. After testing, I found a bug. Search is issed on all columns regardless of their type. In particular:
SELECT COUNT FROM "sys_language" WHERE "pid" IN (22,23,0) AND ((dbms_lob.instr("uid", 'page',1,1) > 0) OR (dbms_lob.instr("title", 'page',1,1) > 0))
This makes the query crash with Oracle as search for 'page' in column "uid" is incorrect. MySQL silently allows this but it does not make sense. As such, patch should be enhanced to search for non-numeric content only on non-numeric columns
Updated by Stefan Neufeind almost 13 years ago
- Target version deleted (
0)
Any chance to get this ironed out and send the patch for review maybe?
Updated by Caspar Stuebs over 10 years ago
- % Done changed from 0 to 100
I tested this again and it seems like this bug is solved in 6.x Versions. It can be closed.
Updated by Stefan Neufeind over 10 years ago
- Status changed from New to Closed
- Is Regression set to No
Closing as requested. Seems to be resolved in 6.x.