[TYPO3-core] RFC: Bug #9408: Selecting by tag using wildcards does not work with database disposal of t3lib_cache

Martin Kutschker masi-no at spam-typo3.org
Mon Sep 22 16:59:12 CEST 2008


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.

Masi


More information about the TYPO3-team-core mailing list