rasmus          Fri Oct  1 15:18:39 2004 EDT

  Modified files:              (Branch: PHP_4_3)
    /php-src/ext/ming   ming.c 
  Log:
  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.
  
  
http://cvs.php.net/diff.php/php-src/ext/ming/ming.c?r1=1.42.2.12&r2=1.42.2.13&ty=u
Index: php-src/ext/ming/ming.c
diff -u php-src/ext/ming/ming.c:1.42.2.12 php-src/ext/ming/ming.c:1.42.2.13
--- php-src/ext/ming/ming.c:1.42.2.12   Fri Nov  7 19:33:57 2003
+++ php-src/ext/ming/ming.c     Fri Oct  1 15:18:39 2004
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: ming.c,v 1.42.2.12 2003/11/08 00:33:57 fmk Exp $ */
+/* $Id: ming.c,v 1.42.2.13 2004/10/01 19:18:39 rasmus Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1444,17 +1444,22 @@
 #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
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to