]> granicus.if.org Git - php/commitdiff
Not sure when this BC breaking change snuck in, but the output method
authorRasmus Lerdorf <rasmus@php.net>
Fri, 1 Oct 2004 19:18:40 +0000 (19:18 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Fri, 1 Oct 2004 19:18:40 +0000 (19:18 +0000)
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.

ext/ming/ming.c

index b678fee587578420b664f85ef7c5560a281c8d90..da0528f5e9a40b6466ee177c0a8fbf498babcbbd 100644 (file)
@@ -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