summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAnatoliy Belsky <ab@php.net>2012-06-05 21:22:27 (GMT)
committerAnatoliy Belsky <ab@php.net>2012-06-07 19:01:32 (GMT)
commitb8cdc731b840cf3b8fd49d34ede7485180326a9c (patch)
treeb92e3489400fb337c7055d1c3e51a39c39c24efa /ext
parenta37e84e549669dbcca0b94a69a5409591eb0c6bb (diff)
downloadphp-b8cdc731b840cf3b8fd49d34ede7485180326a9c.tar.gz
brought the fix for #47667 back
Diffstat (limited to 'ext')
-rw-r--r--ext/zip/lib/zip_open.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c
index 5aba34f..2f56881 100644
--- a/ext/zip/lib/zip_open.c
+++ b/ext/zip/lib/zip_open.c
@@ -61,10 +61,16 @@ ZIP_EXTERN(struct zip *)
zip_open(const char *fn, int flags, int *zep)
{
FILE *fp;
-
+
+ if (flags & ZIP_OVERWRITE) {
+ return _zip_allocate_new(fn, zep);
+ }
+
switch (_zip_file_exists(fn, flags, zep)) {
case -1:
- return NULL;
+ if (!(flags & ZIP_OVERWRITE)) {
+ return NULL;
+ }
case 0:
return _zip_allocate_new(fn, zep);
default: