ZF-10558: Undefined variable in Zend_Cache_Backend_Static
Description
There is undefined $path variable in Zend_Cache_Backend_Static class in method removeRecursively, line 360. There is also no verification if file exists or can it be deleted.
There is undefined $path variable in Zend_Cache_Backend_Static class in method removeRecursively, line 360. There is also no verification if file exists or can it be deleted.
Comments
Posted by Marc Bennewitz (private) (mabe) on 2010-10-30T11:12:46.000+0000
The undefined $path variable is located within Zend_Cache_Backend_Static::removeRecursively but this method will never be called.
Posted by Maciej Wilgucki (batman) on 2010-11-01T09:48:23.000+0000
But it is. You can find it in cache action helper (Zend_Controller_Action_Helper_Cache) in method removePage.
Posted by Adam Lundrigan (adamlundrigan) on 2010-12-19T17:31:36.000+0000
@Marc If the method is never called, should it be removed?
Posted by Ramon Henrique Ornelas (ramon) on 2010-12-19T17:52:08.000+0000
{quote} The undefined $path variable is located within Zend_Cache_Backend_Static::removeRecursively but this method will never be called. {quote} But the method is public.
{quote} If the method is never called, should it be removed? {quote} In case of remotion will cause break BC, same if this is protected because could have a inherit to this class.
And too the framework internally makes call to this see Zend_Controller_Action_Helper_Cache#removePage().
Greetings Ramon
Posted by Adam Lundrigan (adamlundrigan) on 2010-12-19T18:52:30.000+0000
@Ramon Apologies, I realize now my statement was incorrect. I was referring to removing line 353 (in Zend/Cache/Backend/Static.php r22950), as Marc commented that it currently has no effect. However, it may be best to determine the original purpose of this line (ie: what was $path) and fix the code so that it performs the task it was originally intended to.
Posted by Ramon Henrique Ornelas (ramon) on 2011-01-01T18:46:31.000+0000
Fixed in trunk r23605 merged to release branch 1.11 r23606 - thanks.