Sfoglia il codice sorgente

Ensured static cache tag array is initialised to avoid merging NULL to a tag array incorrectly

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20708 44c647ce-9c0f-0410-b52a-842ac1e357ba
padraic 16 anni fa
parent
commit
9170813c52
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      library/Zend/Cache/Backend/Static.php

+ 4 - 1
library/Zend/Cache/Backend/Static.php

@@ -248,6 +248,9 @@ class Zend_Cache_Backend_Static
         if (!isset($this->_tagged[$id])) {
             $this->_tagged[$id] = array();
         }
+        if (!isset($this->_tagged[$id]['tags'])) {
+            $this->_tagged[$id]['tags'] = array();
+        }
         $this->_tagged[$id]['tags'] = array_unique(array_merge($this->_tagged[$id]['tags'], $tags));
         $this->_tagged[$id]['extension'] = $ext;
         $this->getInnerCache()->save($this->_tagged, self::INNER_CACHE_NAME);
@@ -392,7 +395,7 @@ class Zend_Cache_Backend_Static
                 foreach ($tags as $tag) {
                     $urls = array_keys($this->_tagged);
                     foreach ($urls as $url) {
-                        if (in_array($tag, $this->_tagged[$url]['tags'])) {
+                        if (isset($this->_tagged[$url]['tags']) && in_array($tag, $this->_tagged[$url]['tags'])) {
                             $this->remove($url);
                             unset($this->_tagged[$url]);
                         }