@@ -956,7 +956,6 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl
956956 if (handler -> flags & PHP_OUTPUT_HANDLER_USER ) {
957957 zval ob_args [2 ];
958958 zval retval ;
959- ZVAL_UNDEF (& retval );
960959
961960 /* ob_data */
962961 ZVAL_STRINGL (& ob_args [0 ], handler -> buffer .data , handler -> buffer .used );
@@ -969,36 +968,20 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl
969968 handler -> func .user -> fci .retval = & retval ;
970969
971970 if (SUCCESS == zend_call_function (& handler -> func .user -> fci , & handler -> func .user -> fcc ) && Z_TYPE (retval ) != IS_UNDEF ) {
972- if (Z_TYPE ( retval ) != IS_STRING || handler -> flags & PHP_OUTPUT_HANDLER_PRODUCED_OUTPUT ) {
971+ if (handler -> flags & PHP_OUTPUT_HANDLER_PRODUCED_OUTPUT ) {
973972 // Make sure that we don't get lost in the current output buffer
974973 // by disabling it
975974 handler -> flags |= PHP_OUTPUT_HANDLER_DISABLED ;
976- // Make sure we keep a reference to the handler name in
977- // case
978- // * The handler produced output *and* returned a non-string
979- // * The first deprecation message causes the handler to
980- // be removed
981- zend_string * handler_name = handler -> name ;
982- zend_string_addref (handler_name );
983975 if (handler -> flags & PHP_OUTPUT_HANDLER_PRODUCED_OUTPUT ) {
984976 // The handler might not always produce output
985977 handler -> flags &= ~PHP_OUTPUT_HANDLER_PRODUCED_OUTPUT ;
986978 php_error_docref (
987979 NULL ,
988980 E_DEPRECATED ,
989981 "Producing output from user output handler %s is deprecated" ,
990- ZSTR_VAL (handler_name )
991- );
992- }
993- if (Z_TYPE (retval ) != IS_STRING ) {
994- php_error_docref (
995- NULL ,
996- E_DEPRECATED ,
997- "Returning a non-string result from user output handler %s is deprecated" ,
998- ZSTR_VAL (handler_name )
982+ ZSTR_VAL (handler -> name )
999983 );
1000984 }
1001- zend_string_release (handler_name );
1002985
1003986 // Check if the handler is still in the list of handlers to
1004987 // determine if the PHP_OUTPUT_HANDLER_DISABLED flag can
0 commit comments