From f1ab2f022fdc780aca0944d90e9a0e844a0820d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 27 May 2024 13:12:17 +0200 Subject: =?UTF-8?q?2024-02-19:=20popravljen=20(prej=C5=A1nji=20commit=20je?= =?UTF-8?q?=20napa=C4=8Den)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/survey/excel/PHPExcel/Shared/File.php | 139 ---------------------------- 1 file changed, 139 deletions(-) delete mode 100644 admin/survey/excel/PHPExcel/Shared/File.php (limited to 'admin/survey/excel/PHPExcel/Shared/File.php') diff --git a/admin/survey/excel/PHPExcel/Shared/File.php b/admin/survey/excel/PHPExcel/Shared/File.php deleted file mode 100644 index f6314ef..0000000 --- a/admin/survey/excel/PHPExcel/Shared/File.php +++ /dev/null @@ -1,139 +0,0 @@ -open($zipFile) === true) { - $returnValue = ($zip->getFromName($archiveFile) !== false); - $zip->close(); - return $returnValue; - } else { - return false; - } - } else { - // Regular file_exists - return file_exists($pFilename); - } - } - - /** - * Returns canonicalized absolute pathname, also for ZIP archives - * - * @param string $pFilename - * @return string - */ - public static function realpath($pFilename) { - // Returnvalue - $returnValue = ''; - - // Try using realpath() - if (file_exists($pFilename)) { - $returnValue = realpath($pFilename); - } - - // Found something? - if ($returnValue == '' || ($returnValue === NULL)) { - $pathArray = explode('/' , $pFilename); - while(in_array('..', $pathArray) && $pathArray[0] != '..') { - for ($i = 0; $i < count($pathArray); ++$i) { - if ($pathArray[$i] == '..' && $i > 0) { - unset($pathArray[$i]); - unset($pathArray[$i - 1]); - break; - } - } - } - $returnValue = implode('/', $pathArray); - } - - // Return - return $returnValue; - } - - /** - * Get the systems temporary directory. - * - * @return string - */ - public static function sys_get_temp_dir() - { - // sys_get_temp_dir is only available since PHP 5.2.1 - // http://php.net/manual/en/function.sys-get-temp-dir.php#94119 - - if ( !function_exists('sys_get_temp_dir')) { - if ($temp = getenv('TMP') ) { - if ((!empty($temp)) && (file_exists($temp))) { return realpath($temp); } - } - if ($temp = getenv('TEMP') ) { - if ((!empty($temp)) && (file_exists($temp))) { return realpath($temp); } - } - if ($temp = getenv('TMPDIR') ) { - if ((!empty($temp)) && (file_exists($temp))) { return realpath($temp); } - } - - // trick for creating a file in system's temporary dir - // without knowing the path of the system's temporary dir - $temp = tempnam(__FILE__, ''); - if (file_exists($temp)) { - unlink($temp); - return realpath(dirname($temp)); - } - - return null; - } - - // use ordinary built-in PHP function - // There should be no problem with the 5.2.4 Suhosin realpath() bug, because this line should only - // be called if we're running 5.2.1 or earlier - return realpath(sys_get_temp_dir()); - } - -} -- cgit v1.2.3