Issues

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

Issue Type: Bug Created: 2011-12-03T21:51:25.000+0000 Last Updated: 2011-12-03T21:51:25.000+0000 Status: Open Fix version(s): Reporter: Moshe Simantov (ms) Assignee: Alexander Veremyev (alexander) Tags: - Zend_Cache

  • Zend_Cache_Backend_Static

Related issues: Attachments:

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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts