[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 17:06:18 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.

Damn, of course you're right... New patch will follow

olly
-- 
Oliver Hader
TYPO3 4.3 Release Manager


More information about the TYPO3-team-core mailing list