[TYPO3-core] RFC: Bug #9408: Selecting by tag using wildcards does not work with database disposal of t3lib_cache
Oliver Hader
oliver at typo3.org
Mon Sep 22 22:35:17 CEST 2008
Hi Masi,
Martin Kutschker schrieb:
> Oliver Hader schrieb:
>> This is a SVN patch request.
>>
>> Problem:
>> When trying to select cached records by a tag containing wildcards, the
>> new caching framework does not work for the database disposal.
>>
>> Example:
>> $cache = $GLOBALS['TYPO3_CACHE']->create(
>> 'whateverItMightBe',
>> 't3lib_cache_VariableCache',
>> 't3lib_cache_backend_Db',
>> array(...)
>> );
>> $cache->save('elementIdentifier', $content, array('someTag'));
>> $elements = $cache->loadByTag(array('someTag*'));
>>
>> Solution:
>> The asterisk "*" has to be converted for the SQL LIKE statement to "%".
>
> Are % and _ valid characters for tags? If so you must escape them (see
> t3lib_db) before you can use them as values within a LIKE.
I just wanted to correct the patch and realized that
t3lib_db::listQuery() should already use t3lib_db::escapeStrForLike()
for the needle to be searched in a list.
I'm going to create another RFC for the listQuery() thingy...
olly
--
Oliver Hader
TYPO3 4.3 Release Manager
More information about the TYPO3-team-core
mailing list