Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.10.0, 1.10.1, 1.10.2
-
Fix Version/s: 1.10.3
-
Component/s: Zend_Cache
-
Labels:None
Description
Zend/Cache/Backend/File.php:803
if ((is_dir($file)) and ($this->_options['hashed_directory_level']>0)) { // Recursive call $result = array_unique(array_merge($result, $this->_get($file . DIRECTORY_SEPARATOR, $mode, $tags))); }
If the directory $file is empty then this:
line 741
if ($glob === false) { return true; }
will return true and
line 808
return array_unique($result);
will turn it to false (true or false does not matter) - problem is that this is NOT an array.
So next "array_merge()" will start a cascade of errors for each recursive call.
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/libraries/ZendFramework-1.10.0-minimal/library/Zend/Cache/Backend/File.php on line 805
Maybe there is a better solution, but this seems to work fine for me:
line 803
if ((is_dir($file)) and ($this->_options['hashed_directory_level']>0)) { // Recursive call $tmp_result = $this->_get($file . DIRECTORY_SEPARATOR, $mode, $tags); if (is_array($tmp_result)) { $result = array_unique(array_merge($result, $tmp_result)); } }
Best regards, Anton
—
Anton Stöckl
as@pixeltalents.com
http://www.pixeltalents.com
just a code styling change to understand this issue