[BUGFIX] Caching framework db backend: Remove wildcard tag dropping
authorChristian Kuhn <lolli@schwarzbu.ch>
Sun, 19 Jun 2011 13:38:50 +0000 (15:38 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 22 Jun 2011 17:12:22 +0000 (19:12 +0200)
Change-Id: I75fdee1cf996aa21d7c6b71502ade54fd9fa957f
Resolves: #27548
Depends: #27506
Depends: #27536
Depends: #25119
Reviewed-on: http://review.typo3.org/2812
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Stefan Neufeind
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
Reviewed-by: Oliver Klee
Reviewed-by: Björn Pedersen
Tested-by: Björn Pedersen
t3lib/cache/backend/class.t3lib_cache_backend_dbbackend.php

index e1a4a53..35178da 100644 (file)
@@ -314,9 +314,9 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
                $cacheEntryIdentifierRows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
                        $this->identifierField,
                        $this->tableList,
-                       $this->getQueryForTag($tag) .
-                       ' AND ' . $this->tableJoin .
-                       ' AND ' . $this->notExpiredStatement,
+                       $this->tagsTable . '.tag = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($tag, $this->tagsTable) .
+                               ' AND ' . $this->tableJoin .
+                               ' AND ' . $this->notExpiredStatement,
                        $this->identifierField
                );
 
@@ -363,7 +363,7 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
                        );
                }
 
-               $tagsTableWhereClause = $this->getQueryForTag($tag);
+               $tagsTableWhereClause = $this->tagsTable . '.tag = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($tag, $this->tagsTable);
 
                $this->deleteCacheTableRowsByTagsTableWhereClause($tagsTableWhereClause);
 
@@ -521,28 +521,6 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
        }
 
        /**
-        * Gets the query to be used for selecting entries by a tag. The asterisk ("*")
-        * is allowed as a wildcard at the beginning and the end of a tag.
-        *
-        * @param string The tag to search for, the "*" wildcard is supported
-        * @return string the query to be used for selecting entries
-        * @author Oliver Hader <oliver@typo3.org>
-        */
-       protected function getQueryForTag($tag) {
-               if (strpos($tag, '*') === FALSE) {
-                       $query = $this->tagsTable . '.tag = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($tag, $this->tagsTable);
-               } else {
-                       $patternForLike = $GLOBALS['TYPO3_DB']->escapeStrForLike(
-                               $GLOBALS['TYPO3_DB']->quoteStr($tag, $this->tagsTable),
-                               $this->tagsTable
-                       );
-                       $query = $this->tagsTable . '.tag LIKE \'' . $patternForLike . '\'';
-               }
-
-               return $query;
-       }
-
-       /**
         * Deletes rows in cache table found by where clause on tags table
         *
         * @param string The where clause for the tags table