Explorar el Código

fix Zend_Reflection_File to support the changes to realpath() that Suhosin makes which means that you can't trust realpath() to return false if the file doesn't exist. See http://uk3.php.net/manual/en/function.realpath.php#82770

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24726 44c647ce-9c0f-0410-b52a-842ac1e357ba
rob hace 13 años
padre
commit
036a857736
Se han modificado 1 ficheros con 11 adiciones y 2 borrados
  1. 11 2
      library/Zend/Reflection/File.php

+ 11 - 2
library/Zend/Reflection/File.php

@@ -86,8 +86,17 @@ class Zend_Reflection_File implements Reflector
     public function __construct($file)
     {
         $fileName = $file;
-
-        if (($fileRealpath = realpath($fileName)) === false) {
+        
+        $fileRealpath = realpath($fileName);
+        if ($fileRealpath) {
+            // realpath() doesn't return false if Suhosin is included
+            // see http://uk3.php.net/manual/en/function.realpath.php#82770
+            if (!file_exists($fileRealpath)) {
+                $fileRealpath = false;
+            }
+        }
+        
+        if ($fileRealpath === false) {
             $fileRealpath = self::findRealpathInIncludePath($file);
         }