Commit:    b8cdc731b840cf3b8fd49d34ede7485180326a9c
Author:    Anatoliy Belsky <a...@php.net>         Tue, 5 Jun 2012 23:22:27 +0200
Parents:   a37e84e549669dbcca0b94a69a5409591eb0c6bb
Branches:  PHP-5.3 PHP-5.4 master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=b8cdc731b840cf3b8fd49d34ede7485180326a9c

Log:
brought the fix for #47667 back

Bugs:
https://bugs.php.net/47667

Changed paths:
  M  ext/zip/lib/zip_open.c


Diff:
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:


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to