Parcourir la source

ZF-11858: Fix possible fatal error when Zend_Captcha_Image garbage collection runs multiple times in parallel

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24821 44c647ce-9c0f-0410-b52a-842ac1e357ba
adamlundrigan il y a 13 ans
Parent
commit
6ac9f395b1
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      library/Zend/Captcha/Image.php

+ 1 - 1
library/Zend/Captcha/Image.php

@@ -580,7 +580,7 @@ class Zend_Captcha_Image extends Zend_Captcha_Word
         $suffixLength = strlen($this->_suffix);
         foreach (new DirectoryIterator($imgdir) as $file) {
             if (!$file->isDot() && !$file->isDir()) {
-                if ($file->getMTime() < $expire) {
+                if (file_exists($file->getPathname()) && $file->getMTime() < $expire) {
                     // only deletes files ending with $this->_suffix
                     if (substr($file->getFilename(), -($suffixLength)) == $this->_suffix) {
                         unlink($file->getPathname());