From: Rasmus Lerdorf Date: Fri, 1 Oct 2004 19:28:45 +0000 (+0000) Subject: Slightly different fix for HEAD for the ming output method BC breaking X-Git-Tag: PRE_NEW_VM_GEN_PATCH~113 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d85a5d8768ea58c387c81e4a47c9642171b69f7;p=php Slightly different fix for HEAD for the ming output method BC breaking change. --- diff --git a/ext/ming/ming.c b/ext/ming/ming.c index 9bad646777..8d7d7170bf 100644 --- a/ext/ming/ming.c +++ b/ext/ming/ming.c @@ -2207,25 +2207,28 @@ PHP_METHOD(swfmovie, output) #ifdef HAVE_MING_ZLIB zval **zlimit = NULL; int limit = -1; + int argc = ZEND_NUM_ARGS(); int oldval = INT_MIN; long out; - if (zend_get_parameters_ex(1, &zlimit) == FAILURE) { - WRONG_PARAM_COUNT; - } + if(argc) { + 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; + } } oldval = Ming_setSWFCompression(limit); out = SWFMovie_output(movie, &phpByteOutputMethod, NULL); - if (oldval >= -1 && oldval <= 9) + if (oldval >= -1 && oldval <= 9) { Ming_setSWFCompression(oldval); - + } RETURN_LONG(out); #else RETURN_LONG(SWFMovie_output(movie, &phpByteOutputMethod, NULL));