Просмотр исходного кода

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 13 лет назад
Родитель
Сommit
6ac9f395b1
1 измененных файлов с 1 добавлено и 1 удалено
  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());