Fix rare PclZip/realpath/PHP version problem

In PHP 5.4.4 realpath() handles absolute paths correctly, but in PHP 5.3.8 returns false.
This commit is contained in:
Andrew Collins 2014-06-04 13:27:18 -04:00
parent 38d3d7be20
commit d57606082d
1 changed files with 4 additions and 1 deletions

View File

@ -218,7 +218,10 @@ class ZipArchive
{
/** @var \PclZip $zip Type hint */
$zip = $this->zip;
$filename = realpath($filename);
$test_filename = realpath($filename);
if($test_filename !== false) {
$filename = $test_filename;
}
$filenameParts = pathinfo($filename);
$localnameParts = pathinfo($localname);