diff options
| author | Joe Watkins <krakjoe@php.net> | 2017-01-06 16:07:12 +0000 |
|---|---|---|
| committer | Joe Watkins <krakjoe@php.net> | 2017-01-06 16:07:12 +0000 |
| commit | 91cf3269c2ce384f79dde8b01e926b2cb9d98735 (patch) | |
| tree | 9227888b037cfa4b7d7d42261c806408bfd28baf | |
| parent | e114e94c5f238b519cc183a0df92881931d0c9fa (diff) | |
| parent | cc75e8bca5bf4cfb000620156b7e6cf38a22bdeb (diff) | |
| download | php-git-91cf3269c2ce384f79dde8b01e926b2cb9d98735.tar.gz | |
Merge branch 'PHP-7.1' of git.php.net:/php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:/php-src:
Fix #70103: Fix bug 70103 when ZTS is enabled
| -rw-r--r-- | NEWS | 3 | ||||
| -rw-r--r-- | ext/zip/php_zip.c | 10 |
2 files changed, 7 insertions, 6 deletions
@@ -15,7 +15,8 @@ PHP NEWS . Fixed bug #69442 (closing of fd incorrect when PTS enabled). (jaytaph) - ZIP: - . Fixed bug #70103 (ZipArchive::addGlob ignores remove_all_path option). (cmb) + . Fixed bug #70103 (ZipArchive::addGlob ignores remove_all_path option). (cmb, + Mitch Hagstrand) 19 Jan 2017, PHP 7.1.1 diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 5fcd3afc63..bfa473f002 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1699,18 +1699,18 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /* zval_ptr_dtor(return_value); RETURN_FALSE; } - snprintf(entry_name_buf, MAXPATHLEN, "%s%s", add_path, file_stripped); - entry_name = entry_name_buf; - entry_name_len = strlen(entry_name); } else { - entry_name = file_stripped; - entry_name_len = file_stripped_len; + snprintf(entry_name_buf, MAXPATHLEN, "%s", file_stripped); } + + entry_name = entry_name_buf; + entry_name_len = strlen(entry_name); if (basename) { zend_string_release(basename); basename = NULL; } + if (php_zip_add_file(intern, Z_STRVAL_P(zval_file), Z_STRLEN_P(zval_file), entry_name, entry_name_len, 0, 0) < 0) { zval_dtor(return_value); |
