php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #53948
Patch php-5.3.3-ZIP-UTF8.patch revision 2012-02-19 15:47 UTC by asaf at hadasa-oss dot net

Patch php-5.3.3-ZIP-UTF8.patch for Zip Related Bug #53948

Patch version 2012-02-19 15:47 UTC

Return to Bug #53948 | Download this patch
Patch Revisions:

Developer: asaf@hadasa-oss.net

diff -uNr php-5.3.3/ext/zip/lib/zip_close.c php-5.3.3_patched4utf8/ext/zip/lib/zip_close.c
--- php-5.3.3/ext/zip/lib/zip_close.c	2010-02-01 22:56:03.000000000 +0200
+++ php-5.3.3_patched4utf8/ext/zip/lib/zip_close.c	2011-08-10 19:46:08.621450163 +0300
@@ -208,6 +208,9 @@
 	    cd->entry[j].bitflags &= ~ZIP_GPBF_DATA_DESCRIPTOR;
 		}
 	}
+        // TODO: Check actual encoding of filename string.
+        de.bitflags |= ZIP_GPBF_UTF8;
+        cd->entry[j].bitflags |= ZIP_GPBF_UTF8;
 
 	if (za->entry[i].ch_filename) {
 	    free(de.filename);
diff -uNr php-5.3.3/ext/zip/lib/zipint.h php-5.3.3_patched4utf8/ext/zip/lib/zipint.h
--- php-5.3.3/ext/zip/lib/zipint.h	2010-02-01 23:20:07.000000000 +0200
+++ php-5.3.3_patched4utf8/ext/zip/lib/zipint.h	2011-08-10 19:44:16.226450640 +0300
@@ -95,6 +95,7 @@
 #define ZIP_GPBF_ENCRYPTED		0x0001	/* is encrypted */
 #define ZIP_GPBF_DATA_DESCRIPTOR	0x0008	/* crc/size after file data */
 #define ZIP_GPBF_STRONG_ENCRYPTION	0x0040  /* uses strong encryption */
+#define ZIP_GPBF_UTF8                   0x0800  /* uses utf-8 for filenames/comments */
 
 /* error information */
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 23:01:29 2024 UTC