From: Stanislav Malyshev Date: Tue, 2 Sep 2003 09:17:09 +0000 (+0000) Subject: don't report errors if asked not to report X-Git-Tag: php-4.3.4RC1~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7651ed0925e29636467a9bbd876846d2f3be56cc;p=php don't report errors if asked not to report --- diff --git a/main/streams.c b/main/streams.c index 74cb7f3a5a..4585c889c4 100755 --- a/main/streams.c +++ b/main/streams.c @@ -2462,19 +2462,23 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char /* BC with older php scripts and zlib wrapper */ protocol = "compress.zlib"; n = 13; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use \"compress.zlib://\" instead."); + if(options & REPORT_ERRRORS) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use \"compress.zlib://\" instead."); + } } if (protocol) { if (FAILURE == zend_hash_find(&url_stream_wrappers_hash, (char*)protocol, n, (void**)&wrapper)) { char wrapper_name[32]; - if (n >= sizeof(wrapper_name)) - n = sizeof(wrapper_name) - 1; - PHP_STRLCPY(wrapper_name, protocol, sizeof(wrapper_name), n); + if(options & REPORT_ERRRORS) { + if (n >= sizeof(wrapper_name)) + n = sizeof(wrapper_name) - 1; + PHP_STRLCPY(wrapper_name, protocol, sizeof(wrapper_name), n); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unable to find the wrapper \"%s\" - did you forget to enable it when you configured PHP?", - wrapper_name); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unable to find the wrapper \"%s\" - did you forget to enable it when you configured PHP?", + wrapper_name); + } wrapper = NULL; protocol = NULL;