From: Rasmus Lerdorf Date: Fri, 1 Oct 2004 19:18:40 +0000 (+0000) Subject: Not sure when this BC breaking change snuck in, but the output method X-Git-Tag: php-4.3.10RC1~60 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=972ec73cb13151e9f925dc1f9072595e82cf04d7;p=php Not sure when this BC breaking change snuck in, but the output method didn't take an argument before and this compression argument is documented to be optional but in the code it wasn't. This patch fixes the BC break by making the compression argument optional. --- diff --git a/ext/ming/ming.c b/ext/ming/ming.c index b678fee587..da0528f5e9 100644 --- a/ext/ming/ming.c +++ b/ext/ming/ming.c @@ -1444,17 +1444,22 @@ PHP_FUNCTION(swfmovie_output) #ifdef HAVE_MING_ZLIB zval **zlimit = NULL; int limit = -1; + int argc = ZEND_NUM_ARGS(); - if (zend_get_parameters_ex(1, &zlimit) == FAILURE) { - WRONG_PARAM_COUNT; - } + if(argc==0) { + limit = 6; + } else { + if (zend_get_parameters_ex(1, &zlimit) == FAILURE) { + WRONG_PARAM_COUNT; + } - convert_to_long_ex(zlimit); - limit = Z_LVAL_PP(zlimit); + convert_to_long_ex(zlimit); + limit = Z_LVAL_PP(zlimit); - if ((limit < 0) || (limit > 9)) { - php_error(E_WARNING,"compression level must be within 0..9"); - RETURN_FALSE; + if ((limit < 0) || (limit > 9)) { + php_error(E_WARNING,"compression level must be within 0..9"); + RETURN_FALSE; + } } #endif