public function url_stat($path, $flags) { // File and zip case $patchedPath = self::patchPathForBaseDir($path); if (ini_get("open_basedir") && preg_match('/__ZIP_EXTENSION__/', $patchedPath)) { // Zip Folder case self::$lastRealSize = false; $search = basename($path); $realBase = $this->initPath(dirname($path), "dir"); if ($realBase == -1) { if (array_key_exists($search, self::$currentListing)) { return self::$currentListing[$search]; } } } if ($fp = @fopen($path, "r")) { $stat = fstat($fp); fclose($fp); return $stat; } // Folder case $real = $this->initPath($path, "dir", false, true); if ($real != -1 && is_dir($real)) { return stat($real); } // Zip Folder case $search = basename($path); $realBase = $this->initPath(dirname($path), "dir"); if ($realBase == -1) { if (array_key_exists($search, self::$currentListing)) { return self::$currentListing[$search]; } } // 000 permission file if ($real != -1 && is_file($real)) { return stat($real); } // Handle symlinks! if ($real != -1 && is_link($real)) { $realFile = @readlink($real); if (is_file($realFile) || is_dir($realFile)) { return stat($realFile); } else { // symlink is broken, delete it. @unlink($real); return null; } } // Non existing file return null; }