-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Zip: Consider CWD at opening an archive
Summary: Fixes #3981 This one fixes issue [3981](#3981). To be compatible with PHP 5.5 we should consider current working directory `zip_open` and `ZipArchive::open`. Reviewed By: @ptarjan Differential Revision: D1625155
- Loading branch information
1 parent
526e188
commit 043cbb0
Showing
3 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
$archive = "ziparchive_extractto.php.zip"; | ||
$full_path = __DIR__.'/'.$archive; | ||
|
||
function run($filename) { | ||
$zip = zip_open($filename); | ||
var_dump(is_resource($zip)); | ||
|
||
$zip = new ZipArchive; | ||
$res = $zip->open($filename); | ||
var_dump($res); | ||
} | ||
|
||
$initial_cwd = getcwd(); | ||
|
||
// Relative from CWD path. | ||
chdir(__DIR__); | ||
run($archive); | ||
|
||
// Absolute path. | ||
chdir($initial_cwd); | ||
run($full_path); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
bool(true) | ||
bool(true) | ||
bool(true) | ||
bool(true) |