[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/zip/php_zip.c trunk/ext/zip/php_zip.c
felipe Sat, 07 May 2011 01:58:26 + Revision: http://svn.php.net/viewvc?view=revision&revision=310814 Log: - Fixed bug #54681 (addGlob() crashes on invalid flags) Bug: http://bugs.php.net/54681 (Assigned) addGlob() crashes on invalid flags Changed paths: U php/php-src/branches/PHP_5_3/ext/zip/php_zip.c U php/php-src/trunk/ext/zip/php_zip.c Modified: php/php-src/branches/PHP_5_3/ext/zip/php_zip.c === --- php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2011-05-06 22:30:32 UTC (rev 310813) +++ php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2011-05-07 01:58:26 UTC (rev 310814) @@ -494,6 +494,28 @@ #else #define GLOB_FLAGMASK (~0) #endif +#ifndef GLOB_BRACE +# define GLOB_BRACE 0 +#endif +#ifndef GLOB_MARK +# define GLOB_MARK 0 +#endif +#ifndef GLOB_NOSORT +# define GLOB_NOSORT 0 +#endif +#ifndef GLOB_NOCHECK +# define GLOB_NOCHECK 0 +#endif +#ifndef GLOB_NOESCAPE +# define GLOB_NOESCAPE 0 +#endif +#ifndef GLOB_ERR +# define GLOB_ERR 0 +#endif + +/* This is used for checking validity of passed flags (passing invalid flags causes segfault in glob()!! */ +#define GLOB_AVAILABLE_FLAGS (0 | GLOB_BRACE | GLOB_MARK | GLOB_NOSORT | GLOB_NOCHECK | GLOB_NOESCAPE | GLOB_ERR | GLOB_ONLYDIR) + #endif /* }}} */ int php_zip_glob(char *pattern, int pattern_len, long flags, zval *return_value TSRMLS_DC) /* {{{ */ @@ -508,7 +530,17 @@ glob_t globbuf; int n; int ret; + + if (pattern_len >= MAXPATHLEN) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN); + return -1; + } + if ((GLOB_AVAILABLE_FLAGS & flags) != flags) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "At least one of the passed flags is invalid or not supported on this platform"); + return -1; + } + #ifdef ZTS if (!IS_ABSOLUTE_PATH(pattern, pattern_len)) { result = VCWD_GETCWD(cwd, MAXPATHLEN); Modified: php/php-src/trunk/ext/zip/php_zip.c === --- php/php-src/trunk/ext/zip/php_zip.c 2011-05-06 22:30:32 UTC (rev 310813) +++ php/php-src/trunk/ext/zip/php_zip.c 2011-05-07 01:58:26 UTC (rev 310814) @@ -493,6 +493,28 @@ #else #define GLOB_FLAGMASK (~0) #endif +#ifndef GLOB_BRACE +# define GLOB_BRACE 0 +#endif +#ifndef GLOB_MARK +# define GLOB_MARK 0 +#endif +#ifndef GLOB_NOSORT +# define GLOB_NOSORT 0 +#endif +#ifndef GLOB_NOCHECK +# define GLOB_NOCHECK 0 +#endif +#ifndef GLOB_NOESCAPE +# define GLOB_NOESCAPE 0 +#endif +#ifndef GLOB_ERR +# define GLOB_ERR 0 +#endif + +/* This is used for checking validity of passed flags (passing invalid flags causes segfault in glob()!! */ +#define GLOB_AVAILABLE_FLAGS (0 | GLOB_BRACE | GLOB_MARK | GLOB_NOSORT | GLOB_NOCHECK | GLOB_NOESCAPE | GLOB_ERR | GLOB_ONLYDIR) + #endif /* }}} */ int php_zip_glob(char *pattern, int pattern_len, long flags, zval *return_value TSRMLS_DC) /* {{{ */ @@ -507,7 +529,17 @@ glob_t globbuf; int n; int ret; + + if (pattern_len >= MAXPATHLEN) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN); + return -1; + } + if ((GLOB_AVAILABLE_FLAGS & flags) != flags) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "At least one of the passed flags is invalid or not supported on this platform"); + return -1; + } + #ifdef ZTS if (!IS_ABSOLUTE_PATH(pattern, pattern_len)) { result = VCWD_GETCWD(cwd, MAXPATHLEN); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/zip/php_zip.c trunk/ext/zip/php_zip.c
aharvey Fri, 04 Feb 2011 11:51:29 + Revision: http://svn.php.net/viewvc?view=revision&revision=308020 Log: Change the way HAVE_GLOB is dealt with in ext/zip per IRC conversation with Pierre. Changed paths: U php/php-src/branches/PHP_5_3/ext/zip/php_zip.c U php/php-src/trunk/ext/zip/php_zip.c Modified: php/php-src/branches/PHP_5_3/ext/zip/php_zip.c === --- php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2011-02-04 11:24:29 UTC (rev 308019) +++ php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2011-02-04 11:51:29 UTC (rev 308020) @@ -473,10 +473,12 @@ #define GLOB_FLAGMASK (~GLOB_ONLYDIR) #else #define GLOB_FLAGMASK (~0) +#endif #endif /* }}} */ int php_zip_glob(char *pattern, int pattern_len, long flags, zval *return_value TSRMLS_DC) /* {{{ */ { +#ifdef HAVE_GLOB char cwd[MAXPATHLEN]; int cwd_skip = 0; #ifdef ZTS @@ -563,9 +565,12 @@ globfree(&globbuf); return globbuf.gl_pathc; +#else + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Glob support is not available"); + return 0; +#endif /* HAVE_GLOB */ } /* }}} */ -#endif /* HAVE_GLOB */ int php_zip_pcre(char *regexp, int regexp_len, char *path, int path_len, zval *return_value TSRMLS_DC) /* {{{ */ { @@ -665,8 +670,9 @@ return files_cnt; } /* }}} */ -#endif +#endif + /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1) ZEND_ARG_INFO(0, filename) @@ -1591,11 +1597,9 @@ char *add_path = NULL; int pattern_len, add_path_len, remove_path_len, path_len = 0; long remove_all_path = 0; + long flags = 0; zval *options = NULL; int found; -#ifdef HAVE_GLOB - long flags = 0; -#endif if (!this) { RETURN_FALSE; @@ -1604,15 +1608,10 @@ ZIP_FROM_OBJECT(intern, this); /* 1 == glob, 2==pcre */ if (type == 1) { -#ifdef HAVE_GLOB if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|la", &pattern, &pattern_len, &flags, &options) == FAILURE) { return; } -#else - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Glob support is not available"); - RETURN_FALSE; -#endif } else { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sa", &pattern, &pattern_len, &path, &path_len, &options) == FAILURE) { @@ -1635,9 +1634,7 @@ } if (type == 1) { -#ifdef HAVE_GLOB found = php_zip_glob(pattern, pattern_len, flags, return_value TSRMLS_CC); -#endif } else { found = php_zip_pcre(pattern, pattern_len, path, path_len, return_value TSRMLS_CC); } @@ -1696,7 +1693,6 @@ } /* }}} */ -#ifdef HAVE_GLOB /* {{{ proto bool ZipArchive::addGlob(string pattern[,int flags [, array options]]) Add files matching the glob pattern. See php's glob for the pattern syntax. */ static ZIPARCHIVE_METHOD(addGlob) @@ -1704,7 +1700,6 @@ php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ -#endif /* {{{ proto bool ZipArchive::addPattern(string pattern[, string path [, array options]]) Add files matching the pcre pattern. See php's pcre for the pattern syntax. */ @@ -2580,13 +2575,11 @@ ZEND_ARG_INFO(0, dirname) ZEND_END_ARG_INFO() -#ifdef HAVE_GLOB ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_addglob, 0, 0, 1) ZEND_ARG_INFO(0, pattern) ZEND_ARG_INFO(0, flags) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -#endif ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_addpattern, 0, 0, 1) ZEND_ARG_INFO(0, pattern) @@ -2692,9 +2685,7 @@ ZIPARCHIVE_ME(addEmptyDir, arginfo_ziparchive_addemptydir, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(addFromString, arginfo_ziparchive_addfromstring, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(addFile, arginfo_ziparchive_addfile, ZEND_ACC_PUBLIC) -#ifdef HAVE_GLOB ZIPARCHIVE_ME(addGlob, arginfo_ziparchive_addglob, ZEND_ACC_PUBLIC) -#endif ZIPARCHIVE_ME(addPattern, arginfo_ziparchive_addpattern, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(renameIndex, arginfo_ziparchive_renameindex, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(renameName, arginfo_ziparchive_renamename, ZEND_ACC_PUBLIC) Modified: php/php-src/trunk/ext/zip/php_zip.c === --- php/php-src/trunk/ext/zip/php_zip.c 2011-02-04 11:24:29 UTC (rev 308019) +++ php/php-src/trunk/ext/zip/php_zip.c 2011-02-04 11:51:29 UTC (rev 308020) @@ -473,10 +473,12 @@ #define GLOB_FLAGMASK (~GLOB_ONLYDIR) #else #define GLOB_FLAGMASK (~0) +#endif #endif /* }}} */ int php_zip_glob(char *patter
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/zip/php_zip.c trunk/ext/zip/php_zip.c
pajoye Tue, 01 Feb 2011 10:57:51 + Revision: http://svn.php.net/viewvc?view=revision&revision=307905 Log: - WS Changed paths: U php/php-src/branches/PHP_5_3/ext/zip/php_zip.c U php/php-src/trunk/ext/zip/php_zip.c Modified: php/php-src/branches/PHP_5_3/ext/zip/php_zip.c === --- php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2011-02-01 10:52:23 UTC (rev 307904) +++ php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2011-02-01 10:57:51 UTC (rev 307905) @@ -2418,21 +2418,21 @@ break; } } else { -/* Extract all files */ -int filecount = zip_get_num_files(intern); + /* Extract all files */ + int filecount = zip_get_num_files(intern); -if (filecount == -1) { -php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal archive"); -RETURN_FALSE; -} + if (filecount == -1) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal archive"); + RETURN_FALSE; + } -for (i = 0; i < filecount; i++) { - char *file = (char*)zip_get_name(intern, i, ZIP_FL_UNCHANGED); -if (!php_zip_extract_file(intern, pathto, file, strlen(file) TSRMLS_CC)) { -RETURN_FALSE; -} -} -} + for (i = 0; i < filecount; i++) { + char *file = (char*)zip_get_name(intern, i, ZIP_FL_UNCHANGED); + if (!php_zip_extract_file(intern, pathto, file, strlen(file) TSRMLS_CC)) { + RETURN_FALSE; + } + } + } RETURN_TRUE; } /* }}} */ Modified: php/php-src/trunk/ext/zip/php_zip.c === --- php/php-src/trunk/ext/zip/php_zip.c 2011-02-01 10:52:23 UTC (rev 307904) +++ php/php-src/trunk/ext/zip/php_zip.c 2011-02-01 10:57:51 UTC (rev 307905) @@ -2379,12 +2379,12 @@ RETURN_FALSE; } -if (php_stream_stat_path_ex(pathto, PHP_STREAM_URL_STAT_QUIET, &ssb, NULL) < 0) { -ret = php_stream_mkdir(pathto, 0777, PHP_STREAM_MKDIR_RECURSIVE, NULL); -if (!ret) { -RETURN_FALSE; -} -} + if (php_stream_stat_path_ex(pathto, PHP_STREAM_URL_STAT_QUIET, &ssb, NULL) < 0) { + ret = php_stream_mkdir(pathto, 0777, PHP_STREAM_MKDIR_RECURSIVE, NULL); + if (!ret) { + RETURN_FALSE; + } + } ZIP_FROM_OBJECT(intern, this); if (zval_files && (Z_TYPE_P(zval_files) != IS_NULL)) { @@ -2419,21 +2419,21 @@ break; } } else { -/* Extract all files */ -int filecount = zip_get_num_files(intern); + /* Extract all files */ + int filecount = zip_get_num_files(intern); -if (filecount == -1) { -php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal archive"); -RETURN_FALSE; -} + if (filecount == -1) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal archive"); + RETURN_FALSE; + } -for (i = 0; i < filecount; i++) { + for (i = 0; i < filecount; i++) { char *file = (char*)zip_get_name(intern, i, ZIP_FL_UNCHANGED); -if (!php_zip_extract_file(intern, pathto, file, strlen(file) TSRMLS_CC)) { -RETURN_FALSE; -} -} -} + if (!php_zip_extract_file(intern, pathto, file, strlen(file) TSRMLS_CC)) { + RETURN_FALSE; + } + } + } RETURN_TRUE; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/zip/php_zip.c trunk/ext/zip/php_zip.c
iliaaMon, 20 Sep 2010 12:48:27 + Revision: http://svn.php.net/viewvc?view=revision&revision=303622 Log: Fixed a compiler warning Changed paths: U php/php-src/branches/PHP_5_3/ext/zip/php_zip.c U php/php-src/trunk/ext/zip/php_zip.c Modified: php/php-src/branches/PHP_5_3/ext/zip/php_zip.c === --- php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2010-09-20 12:34:44 UTC (rev 303621) +++ php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2010-09-20 12:48:27 UTC (rev 303622) @@ -1649,7 +1649,7 @@ if (add_path) { if ((add_path_len + file_stripped_len) > MAXPATHLEN) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Entry name too long (max: %i, %i given)", + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Entry name too long (max: %d, %ld given)", MAXPATHLEN - 1, (add_path_len + file_stripped_len)); zval_dtor(return_value); RETURN_FALSE; Modified: php/php-src/trunk/ext/zip/php_zip.c === --- php/php-src/trunk/ext/zip/php_zip.c 2010-09-20 12:34:44 UTC (rev 303621) +++ php/php-src/trunk/ext/zip/php_zip.c 2010-09-20 12:48:27 UTC (rev 303622) @@ -1662,7 +1662,7 @@ if (add_path) { if ((add_path_len + file_stripped_len) > MAXPATHLEN) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Entry name too long (max: %i, %i given)", + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Entry name too long (max: %d, %ld given)", MAXPATHLEN - 1, (add_path_len + file_stripped_len)); zval_dtor(return_value); RETURN_FALSE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/zip/php_zip.c trunk/ext/zip/php_zip.c
felipe Thu, 03 Jun 2010 18:39:21 + Revision: http://svn.php.net/viewvc?view=revision&revision=300169 Log: - Fix proto and argname Changed paths: U php/php-src/branches/PHP_5_3/ext/zip/php_zip.c U php/php-src/trunk/ext/zip/php_zip.c Modified: php/php-src/branches/PHP_5_3/ext/zip/php_zip.c === --- php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2010-06-03 18:23:14 UTC (rev 300168) +++ php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2010-06-03 18:39:21 UTC (rev 300169) @@ -2306,7 +2306,7 @@ } /* }}} */ -/* {{{ proto bool ZipArchive::unchangeAll() +/* {{{ proto bool ZipArchive::unchangeArchive() Revert all global changes to the archive archive. For now, this only reverts archive comment changes. */ static ZIPARCHIVE_METHOD(unchangeArchive) { @@ -2492,7 +2492,7 @@ } /* }}} */ -/* {{{ proto string ZipArchive::getFromIndex(string entryname[, int len [, int flags]]) +/* {{{ proto string ZipArchive::getFromIndex(int index[, int len [, int flags]]) get the contents of an entry using its index */ static ZIPARCHIVE_METHOD(getFromIndex) { @@ -2631,7 +2631,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_getfromindex, 0, 0, 1) - ZEND_ARG_INFO(0, entryname) + ZEND_ARG_INFO(0, index) ZEND_ARG_INFO(0, len) ZEND_ARG_INFO(0, flags) ZEND_END_ARG_INFO() Modified: php/php-src/trunk/ext/zip/php_zip.c === --- php/php-src/trunk/ext/zip/php_zip.c 2010-06-03 18:23:14 UTC (rev 300168) +++ php/php-src/trunk/ext/zip/php_zip.c 2010-06-03 18:39:21 UTC (rev 300169) @@ -2319,7 +2319,7 @@ } /* }}} */ -/* {{{ proto bool ZipArchive::unchangeAll() +/* {{{ proto bool ZipArchive::unchangeArchive() Revert all global changes to the archive archive. For now, this only reverts archive comment changes. */ static ZIPARCHIVE_METHOD(unchangeArchive) { @@ -2505,7 +2505,7 @@ } /* }}} */ -/* {{{ proto string ZipArchive::getFromIndex(string entryname[, int len [, int flags]]) +/* {{{ proto string ZipArchive::getFromIndex(int index[, int len [, int flags]]) get the contents of an entry using its index */ static ZIPARCHIVE_METHOD(getFromIndex) { @@ -2644,7 +2644,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_getfromindex, 0, 0, 1) - ZEND_ARG_INFO(0, entryname) + ZEND_ARG_INFO(0, index) ZEND_ARG_INFO(0, len) ZEND_ARG_INFO(0, flags) ZEND_END_ARG_INFO() -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/zip/php_zip.c trunk/ext/zip/php_zip.c
felipe Thu, 03 Jun 2010 18:23:14 + Revision: http://svn.php.net/viewvc?view=revision&revision=300168 Log: - Added ZipArchive arginfo Changed paths: U php/php-src/branches/PHP_5_3/ext/zip/php_zip.c U php/php-src/trunk/ext/zip/php_zip.c Modified: php/php-src/branches/PHP_5_3/ext/zip/php_zip.c === --- php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2010-06-03 16:35:49 UTC (rev 300167) +++ php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2010-06-03 18:23:14 UTC (rev 300168) @@ -2536,38 +2536,143 @@ } /* }}} */ +/* {{{ arginfo */ +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_open, 0, 0, 1) + ZEND_ARG_INFO(0, source) + ZEND_ARG_INFO(0, flags) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO(arginfo_ziparchive__void, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_addemptydir, 0, 0, 1) + ZEND_ARG_INFO(0, dirname) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_addglob, 0, 0, 1) + ZEND_ARG_INFO(0, pattern) + ZEND_ARG_INFO(0, flags) + ZEND_ARG_INFO(0, options) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_addpattern, 0, 0, 1) + ZEND_ARG_INFO(0, pattern) + ZEND_ARG_INFO(0, path) + ZEND_ARG_INFO(0, options) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_addfile, 0, 0, 1) + ZEND_ARG_INFO(0, filepath) + ZEND_ARG_INFO(0, entryname) + ZEND_ARG_INFO(0, start) + ZEND_ARG_INFO(0, length) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_addfromstring, 0, 0, 2) + ZEND_ARG_INFO(0, name) + ZEND_ARG_INFO(0, content) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_statname, 0, 0, 1) + ZEND_ARG_INFO(0, filename) + ZEND_ARG_INFO(0, flags) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_statindex, 0, 0, 1) + ZEND_ARG_INFO(0, index) + ZEND_ARG_INFO(0, flags) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_setarchivecomment, 0, 0, 2) + ZEND_ARG_INFO(0, name) + ZEND_ARG_INFO(0, comment) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_setcommentindex, 0, 0, 2) + ZEND_ARG_INFO(0, index) + ZEND_ARG_INFO(0, comment) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_getcommentname, 0, 0, 1) + ZEND_ARG_INFO(0, name) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_getcommentindex, 0, 0, 1) + ZEND_ARG_INFO(0, index) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_renameindex, 0, 0, 2) + ZEND_ARG_INFO(0, index) + ZEND_ARG_INFO(0, new_name) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_renamename, 0, 0, 2) + ZEND_ARG_INFO(0, name) + ZEND_ARG_INFO(0, new_name) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_unchangeindex, 0, 0, 1) + ZEND_ARG_INFO(0, index) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_unchangename, 0, 0, 1) + ZEND_ARG_INFO(0, name) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_extractto, 0, 0, 1) + ZEND_ARG_INFO(0, pathto) + ZEND_ARG_INFO(0, files) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_getfromname, 0, 0, 1) + ZEND_ARG_INFO(0, entryname) + ZEND_ARG_INFO(0, len) + ZEND_ARG_INFO(0, flags) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_getfromindex, 0, 0, 1) + ZEND_ARG_INFO(0, entryname) + ZEND_ARG_INFO(0, len) + ZEND_ARG_INFO(0, flags) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_getstream, 0, 0, 1) + ZEND_ARG_INFO(0, entryname) +ZEND_END_ARG_INFO() +/* }}} */ + /* {{{ ze_zip_object_class_functions */ static const zend_function_entry zip_class_functions[] = { - ZIPARCHIVE_ME(open,NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(close,NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(getStatusString, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(addEmptyDir, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(addFromString, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(addFile, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(addGlob, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(addPattern, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(renameIndex, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(renameName, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(setArchiveComment, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(getArchiveComment, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(setCommentIndex, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(setCommentName, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(getCommentIndex, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(getCommentName, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(deleteIndex, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(deleteName, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(statName, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(statIndex, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(locateName, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(getNameIndex, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(unchangeArchive, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(unchangeAll, NULL, ZEND_ACC_PUBLIC) - ZIPARCHIVE_ME(unchangeIndex, NULL, ZEND_AC
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/zip/php_zip.c trunk/ext/zip/php_zip.c
rasmus Tue, 09 Feb 2010 17:38:36 + Revision: http://svn.php.net/viewvc?view=revision&revision=294816 Log: It's a size_t here, not an unsigned int. Changed paths: U php/php-src/branches/PHP_5_3/ext/zip/php_zip.c U php/php-src/trunk/ext/zip/php_zip.c Modified: php/php-src/branches/PHP_5_3/ext/zip/php_zip.c === --- php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2010-02-09 16:42:40 UTC (rev 294815) +++ php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2010-02-09 17:38:36 UTC (rev 294816) @@ -182,7 +182,7 @@ len = spprintf(&file_dirname_fullpath, 0, "%s/%s", dest, file_dirname); } - php_basename(path_cleaned, path_cleaned_len, NULL, 0, &file_basename, (unsigned int *)&file_basename_len TSRMLS_CC); + php_basename(path_cleaned, path_cleaned_len, NULL, 0, &file_basename, (size_t *)&file_basename_len TSRMLS_CC); if (OPENBASEDIR_CHECKPATH(file_dirname_fullpath)) { efree(file_dirname_fullpath); @@ -1637,7 +1637,7 @@ file = Z_STRVAL_PP(zval_file); if (remove_all_path) { php_basename(Z_STRVAL_PP(zval_file), Z_STRLEN_PP(zval_file), NULL, 0, - &basename, (unsigned int *)&file_stripped_len TSRMLS_CC); + &basename, (size_t *)&file_stripped_len TSRMLS_CC); file_stripped = basename; } else if (remove_path && strstr(Z_STRVAL_PP(zval_file), remove_path) != NULL) { file_stripped = Z_STRVAL_PP(zval_file) + remove_path_len + 1; Modified: php/php-src/trunk/ext/zip/php_zip.c === --- php/php-src/trunk/ext/zip/php_zip.c 2010-02-09 16:42:40 UTC (rev 294815) +++ php/php-src/trunk/ext/zip/php_zip.c 2010-02-09 17:38:36 UTC (rev 294816) @@ -182,7 +182,7 @@ len = spprintf(&file_dirname_fullpath, 0, "%s/%s", dest, file_dirname); } - php_basename(path_cleaned, path_cleaned_len, NULL, 0, &file_basename, (unsigned int *)&file_basename_len TSRMLS_CC); + php_basename(path_cleaned, path_cleaned_len, NULL, 0, &file_basename, (size_t *)&file_basename_len TSRMLS_CC); if (OPENBASEDIR_CHECKPATH(file_dirname_fullpath)) { efree(file_dirname_fullpath); @@ -1647,7 +1647,7 @@ file = Z_STRVAL_PP(zval_file); if (remove_all_path) { php_basename(Z_STRVAL_PP(zval_file), Z_STRLEN_PP(zval_file), NULL, 0, - &basename, (unsigned int *)&file_stripped_len TSRMLS_CC); + &basename, (size_t *)&file_stripped_len TSRMLS_CC); file_stripped = basename; } else if (remove_path && strstr(Z_STRVAL_PP(zval_file), remove_path) != NULL) { file_stripped = Z_STRVAL_PP(zval_file) + remove_path_len + 1; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php