@@ -286,10 +286,8 @@ static void php_stream_wrapper_error_internal_with_name(const char *wrapper_name
286286{
287287 zend_string * message = vstrpprintf (0 , fmt , args );
288288
289- if (options & REPORT_ERRORS ) {
290- php_stream_process_error (context , wrapper_name , NULL , docref , code , ZSTR_VAL (message ),
291- param , severity , terminal );
292- }
289+ php_stream_process_error (context , wrapper_name , NULL , docref , code , ZSTR_VAL (message ),
290+ param , severity , terminal );
293291
294292 php_stream_store_error_common (
295293 context , NULL , message , docref , code , wrapper_name , param , severity , terminal );
@@ -311,48 +309,56 @@ PHPAPI void php_stream_wrapper_error_with_name(const char *wrapper_name,
311309 php_stream_context * context , const char * docref , int options , int severity , bool terminal ,
312310 int code , const char * fmt , ...)
313311{
314- va_list args ;
315- va_start (args , fmt );
316- php_stream_wrapper_error_internal_with_name (
317- wrapper_name , context , docref , options , severity , terminal , code , NULL , fmt , args );
318- va_end (args );
312+ if (options & REPORT_ERRORS ) {
313+ va_list args ;
314+ va_start (args , fmt );
315+ php_stream_wrapper_error_internal_with_name (
316+ wrapper_name , context , docref , options , severity , terminal , code , NULL , fmt , args );
317+ va_end (args );
318+ }
319319}
320320
321321PHPAPI void php_stream_wrapper_error (php_stream_wrapper * wrapper , php_stream_context * context ,
322322 const char * docref , int options , int severity , bool terminal , int code , const char * fmt ,
323323 ...)
324324{
325- va_list args ;
326- va_start (args , fmt );
327- php_stream_wrapper_error_internal (
328- wrapper , context , docref , options , severity , terminal , code , NULL , fmt , args );
329- va_end (args );
325+ if (options & REPORT_ERRORS ) {
326+ va_list args ;
327+ va_start (args , fmt );
328+ php_stream_wrapper_error_internal (
329+ wrapper , context , docref , options , severity , terminal , code , NULL , fmt , args );
330+ va_end (args );
331+ }
330332}
331333
332334PHPAPI void php_stream_wrapper_error_param (php_stream_wrapper * wrapper , php_stream_context * context ,
333335 const char * docref , int options , int severity , bool terminal , int code , const char * param ,
334336 const char * fmt , ...)
335337{
336- va_list args ;
337- va_start (args , fmt );
338- char * param_copy = param ? estrdup (param ): NULL ;
339- php_stream_wrapper_error_internal (
340- wrapper , context , docref , options , severity , terminal , code , param_copy , fmt , args );
341- va_end (args );
338+ if (options & REPORT_ERRORS ) {
339+ va_list args ;
340+ va_start (args , fmt );
341+ char * param_copy = param ? estrdup (param ): NULL ;
342+ php_stream_wrapper_error_internal (
343+ wrapper , context , docref , options , severity , terminal , code , param_copy , fmt , args );
344+ va_end (args );
345+ }
342346}
343347
344348PHPAPI void php_stream_wrapper_error_param2 (php_stream_wrapper * wrapper ,
345349 php_stream_context * context , const char * docref , int options , int severity , bool terminal ,
346350 int code , const char * param1 , const char * param2 , const char * fmt , ...)
347351{
348- char * combined_param ;
349- spprintf (& combined_param , 0 , "%s,%s" , param1 , param2 );
350-
351- va_list args ;
352- va_start (args , fmt );
353- php_stream_wrapper_error_internal (
354- wrapper , context , docref , options , severity , terminal , code , combined_param , fmt , args );
355- va_end (args );
352+ if (options & REPORT_ERRORS ) {
353+ char * combined_param ;
354+ spprintf (& combined_param , 0 , "%s,%s" , param1 , param2 );
355+
356+ va_list args ;
357+ va_start (args , fmt );
358+ php_stream_wrapper_error_internal (
359+ wrapper , context , docref , options , severity , terminal , code , combined_param , fmt , args );
360+ va_end (args );
361+ }
356362}
357363
358364/* Wrapper error logging - stores in FG(wrapper_logged_errors) */
@@ -394,13 +400,12 @@ static void php_stream_wrapper_log_error_internal(const php_stream_wrapper *wrap
394400 /* Report immediately using standard error functions */
395401 php_stream_wrapper_error_internal_with_name (
396402 wrapper_name , context , NULL , options , severity , terminal , code , param , fmt , args );
397- zend_string_release (message );
398403 } else {
399404 /* Store for later display in FG(wrapper_logged_errors) */
400405 php_stream_wrapper_log_store_error (
401406 message , code , wrapper_name , param , severity , terminal );
402- zend_string_release (message );
403407 }
408+ zend_string_release (message );
404409}
405410
406411PHPAPI void php_stream_wrapper_log_error (const php_stream_wrapper * wrapper ,
0 commit comments