Grokbase Groups PHP php-cvs May 2016
FAQ
Commit: 893c2405ff34250ffefbbc1d223de4df6c154c8a
Author: Anatol Belski <ab@php.net> Wed, 25 May 2016 22:10:24 +0200
Parents: 38be3b28cb601f6015141eecfdb69bb5ce6c2b05
Branches: master

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

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.

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..be35c2d 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -3038,6 +3038,37 @@ 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
+
+/* XXX The below are rather not implemented or to check whether makes sense to expose. */
+/*#ifdef ZIP_FL_RECOMPRESS
+ REGISTER_ZIP_CLASS_CONST_LONG("FL_RECOMPRESS", ZIP_FL_RECOMPRESS);
+#endif
+#ifdef ZIP_FL_ENCRYPTED
+ REGISTER_ZIP_CLASS_CONST_LONG("FL_ENCRYPTED", ZIP_FL_ENCRYPTED);
+#endif
+#ifdef ZIP_FL_LOCAL
+ REGISTER_ZIP_CLASS_CONST_LONG("FL_LOCAL", ZIP_FL_LOCAL);
+#endif
+#ifdef ZIP_FL_CENTRAL
+ REGISTER_ZIP_CLASS_CONST_LONG("FL_CENTRAL", ZIP_FL_CENTRAL);
+#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 27, 2016 at 10:42 am
    Hi Ferenc,
    -----Original Message-----
    From: Anatol Belski
    Sent: Wednesday, May 25, 2016 10:13 PM
    To: php-cvs@lists.php.net
    Subject: [PHP-CVS] com php-src: Expose missing flags from libzip at least >=
    0.11.x: ext/zip/php_zip.c

    Commit: 893c2405ff34250ffefbbc1d223de4df6c154c8a
    Author: Anatol Belski <ab@php.net> Wed, 25 May 2016 22:10:24 +0200
    Parents: 38be3b28cb601f6015141eecfdb69bb5ce6c2b05
    Branches: master

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

    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.

    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..be35c2d 100644
    --- a/ext/zip/php_zip.c
    +++ b/ext/zip/php_zip.c
    @@ -3038,6 +3038,37 @@ 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
    +
    Would you mind adding these constants to 5.6? This would help to workaround issues from https://bugs.php.net/bug.php?id=72258 .

    Regards

    Anatol

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-cvs @
categoriesphp
postedMay 25, '16 at 8:14p
activeMay 27, '16 at 10:42a
posts2
users2
websitephp.net

2 users in discussion

Anatol Belski: 1 post Anatol Belski: 1 post

People

Translate

site design / logo © 2019 Grokbase