Issues

ZF-11924: Zend_Cache_Backend_Static::_verifyPath dosn't work!

Description

_verifyPath check the id agents public_dir incorrectly.

First, there is a documentation error: if the id isn't found the method will return false - This will cause an exception on Zend_Cache_Backend_Static::load and Zend_Cache_Backend_Static::test methods!

Second, the comparing should be agents both full paths. Right now "$path" will return false on almost any case and then the method will return true.

My temp fix:

protected function _verifyPath($path)
{
    $path = realpath($this->_options['public_dir'] . $path);
    $base = realpath($this->_options['public_dir']);

    return ($path === false || strncmp($path, $base, strlen($base)) === 0);
}

Comments

No comments to display