diff options
author | Dmitry Stogov <dmitry@zend.com> | 2021-02-26 02:28:46 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2021-02-26 02:28:46 +0300 |
commit | 13e4ce386bb7257dbbe3167b070382ea959ec763 (patch) | |
tree | bf73295d32470a3e85d84dc244655f37c550c386 /ext/zip/php_zip.c | |
parent | 5e8ae15c3d59f5ee4ca9f51b4ee712e2ada67864 (diff) | |
download | php-git-13e4ce386bb7257dbbe3167b070382ea959ec763.tar.gz |
Improve SPL directory and stat() cache using zend_srting* instead of char*
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r-- | ext/zip/php_zip.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index a3b266bba8..e62f9fc8f9 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -280,8 +280,7 @@ static int php_zip_add_file(ze_zip_object *obj, const char *filename, size_t fil { struct zip_source *zs; char resolved_path[MAXPATHLEN]; - zval exists_flag; - + php_stream_statbuf ssb; if (ZIP_OPENBASEDIR_CHECKPATH(filename)) { return -1; @@ -292,8 +291,7 @@ static int php_zip_add_file(ze_zip_object *obj, const char *filename, size_t fil return -1; } - php_stat(resolved_path, strlen(resolved_path), FS_EXISTS, &exists_flag); - if (Z_TYPE(exists_flag) == IS_FALSE) { + if (php_stream_stat_path_ex(resolved_path, PHP_STREAM_URL_STAT_QUIET, &ssb, NULL)) { php_error_docref(NULL, E_WARNING, "No such file or directory"); return -1; } |