}
/* let see if the path already exists */
- if (php_stream_stat_path(file_dirname_fullpath, &ssb) < 0) {
+ if (php_stream_stat_path_ex(file_dirname_fullpath, PHP_STREAM_URL_STAT_QUIET, &ssb, NULL) < 0) {
#if defined(PHP_WIN32) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1)
char *e;
RETURN_FALSE;
}
- if (php_stream_stat_path(pathto, &ssb) < 0) {
+ 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;
--- /dev/null
+--TEST--
+Bug #53603 (ZipArchive should quiet stat errors)
+--SKIPIF--
+<?php
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+
+class TestStream {
+ function url_stat($path, $flags) {
+ if (!($flags & STREAM_URL_STAT_QUIET))
+ trigger_error("not quiet");
+ return array();
+ }
+}
+
+stream_wrapper_register("teststream", "TestStream");
+
+$dirname = dirname(__FILE__) . '/';
+$file = $dirname . 'test_with_comment.zip';
+$zip = new ZipArchive;
+if ($zip->open($file) !== TRUE) {
+ echo "open failed.\n";
+ exit('failed');
+}
+
+$a = $zip->extractTo('teststream://test');
+var_dump($a);
+
+--EXPECTF--
+Warning: ZipArchive::extractTo(teststream://test/foo): failed to open stream: "TestStream::stream_open" call failed in %s on line %d
+
+Warning: ZipArchive::extractTo(teststream://test/bar): failed to open stream: "TestStream::stream_open" call failed in %s on line %d
+
+Warning: ZipArchive::extractTo(teststream://test/foobar/baz): failed to open stream: "TestStream::stream_open" call failed in %s on line %d
+bool(true)
+