Grokbase Groups PHP php-cvs May 2016
FAQ
Commit: 63595aef3d8419f918ee3f8dd3a97969b9518799
Author: Anatol Belski <ab@php.net> Mon, 30 May 2016 10:16:12 +0200
Parents: 0c5bd4d445ab09fd457882c06eff436eebb4c9bf
Branches: master

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

Log:
Expose missing flags from libzip at least >= 0.11.x

These are helpful with reading/writing zips containing non UTF-8
filenames to mitigate possibly changed libzip behaviors.

Partial cherry-pick of 893c2405ff34250ffefbbc1d223de4df6c154c8a

Changed paths:
   M ext/zip/php_zip.c


Diff:
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 7c9adf4..88bb518 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -3038,6 +3038,24 @@ static PHP_MINIT_FUNCTION(zip)
   REGISTER_ZIP_CLASS_CONST_LONG("FL_NODIR", ZIP_FL_NODIR);
   REGISTER_ZIP_CLASS_CONST_LONG("FL_COMPRESSED", ZIP_FL_COMPRESSED);
   REGISTER_ZIP_CLASS_CONST_LONG("FL_UNCHANGED", ZIP_FL_UNCHANGED);
+
+#ifdef ZIP_FL_ENC_GUESS
+ /* Default filename encoding policy. */
+ REGISTER_ZIP_CLASS_CONST_LONG("FL_ENC_GUESS", ZIP_FL_ENC_GUESS);
+#endif
+#ifdef ZIP_FL_ENC_RAW
+ REGISTER_ZIP_CLASS_CONST_LONG("FL_ENC_RAW", ZIP_FL_ENC_RAW);
+#endif
+#ifdef ZIP_FL_ENC_STRICT
+ REGISTER_ZIP_CLASS_CONST_LONG("FL_ENC_STRICT", ZIP_FL_ENC_STRICT);
+#endif
+#ifdef ZIP_FL_ENC_UTF_8
+ REGISTER_ZIP_CLASS_CONST_LONG("FL_ENC_UTF_8", ZIP_FL_ENC_UTF_8);
+#endif
+#ifdef ZIP_FL_ENC_CP437
+ REGISTER_ZIP_CLASS_CONST_LONG("FL_ENC_CP437", ZIP_FL_ENC_CP437);
+#endif
+
   REGISTER_ZIP_CLASS_CONST_LONG("CM_DEFAULT", ZIP_CM_DEFAULT);
   REGISTER_ZIP_CLASS_CONST_LONG("CM_STORE", ZIP_CM_STORE);
   REGISTER_ZIP_CLASS_CONST_LONG("CM_SHRINK", ZIP_CM_SHRINK);

Search Discussions

  • Anatol Belski at May 30, 2016 at 8:33 am
    Commit: 2c80459c24c7e124239b61d3773c076fc38b10d2
    Author: Anatol Belski <ab@php.net> Mon, 30 May 2016 10:16:12 +0200
    Parents: 1690dcb827e2b50eb575b1c6acadab0b8f248723
    Branches: PHP-7.0

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

    Log:
    Expose missing flags from libzip at least >= 0.11.x

    These are helpful with reading/writing zips containing non UTF-8
    filenames to mitigate possibly changed libzip behaviors.

    Partial cherry-pick of 893c2405ff34250ffefbbc1d223de4df6c154c8a

    Changed paths:
       M ext/zip/php_zip.c


    Diff:
    diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
    index 7c9adf4..88bb518 100644
    --- a/ext/zip/php_zip.c
    +++ b/ext/zip/php_zip.c
    @@ -3038,6 +3038,24 @@ static PHP_MINIT_FUNCTION(zip)
       REGISTER_ZIP_CLASS_CONST_LONG("FL_NODIR", ZIP_FL_NODIR);
       REGISTER_ZIP_CLASS_CONST_LONG("FL_COMPRESSED", ZIP_FL_COMPRESSED);
       REGISTER_ZIP_CLASS_CONST_LONG("FL_UNCHANGED", ZIP_FL_UNCHANGED);
    +
    +#ifdef ZIP_FL_ENC_GUESS
    + /* Default filename encoding policy. */
    + REGISTER_ZIP_CLASS_CONST_LONG("FL_ENC_GUESS", ZIP_FL_ENC_GUESS);
    +#endif
    +#ifdef ZIP_FL_ENC_RAW
    + REGISTER_ZIP_CLASS_CONST_LONG("FL_ENC_RAW", ZIP_FL_ENC_RAW);
    +#endif
    +#ifdef ZIP_FL_ENC_STRICT
    + REGISTER_ZIP_CLASS_CONST_LONG("FL_ENC_STRICT", ZIP_FL_ENC_STRICT);
    +#endif
    +#ifdef ZIP_FL_ENC_UTF_8
    + REGISTER_ZIP_CLASS_CONST_LONG("FL_ENC_UTF_8", ZIP_FL_ENC_UTF_8);
    +#endif
    +#ifdef ZIP_FL_ENC_CP437
    + REGISTER_ZIP_CLASS_CONST_LONG("FL_ENC_CP437", ZIP_FL_ENC_CP437);
    +#endif
    +
       REGISTER_ZIP_CLASS_CONST_LONG("CM_DEFAULT", ZIP_CM_DEFAULT);
       REGISTER_ZIP_CLASS_CONST_LONG("CM_STORE", ZIP_CM_STORE);
       REGISTER_ZIP_CLASS_CONST_LONG("CM_SHRINK", ZIP_CM_SHRINK);

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-cvs @
categoriesphp
postedMay 30, '16 at 8:32a
activeMay 30, '16 at 8:33a
posts2
users1
websitephp.net

1 user in discussion

Anatol Belski: 2 posts

People

Translate

site design / logo © 2019 Grokbase