imagefilter() duplicate "wrong param count" message
| From: | Hannes Magnusson | Date: | Sun, 08 Oct 2006 14:16:22 +0000 |
| Subject: | imagefilter() duplicate "wrong param count" message | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-25992@lists.php.net to get a copy of this message | ||
imagefilter() currently throws double "wrong param count" error.
Attached is a patch for HEAD that fixes it.
-Hannes
Index: ext/gd/gd.c =================================================================== RCS file: /repository/php-src/ext/gd/gd.c,v retrieving revision 1.358 diff -u -r1.358 gd.c --- ext/gd/gd.c 7 Oct 2006 18:12:04 -0000 1.358 +++ ext/gd/gd.c 8 Oct 2006 14:11:47 -0000 @@ -4509,8 +4509,10 @@ php_image_filter_smooth }; - if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 5 || zend_parse_parameters(2 TSRMLS_CC, "rl", &tmp, &filtertype) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); + if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 5) { + WRONG_PARAM_COUNT; + } else if (zend_parse_parameters(2 TSRMLS_CC, "rl", &tmp, &filtertype) == FAILURE) { + return; } if (filtertype >= 0 && filtertype <= IMAGE_FILTER_MAX) {
Index: ext/gd/gd.c =================================================================== RCS file: /repository/php-src/ext/gd/gd.c,v retrieving revision 1.358 diff -u -r1.358 gd.c --- ext/gd/gd.c 7 Oct 2006 18:12:04 -0000 1.358 +++ ext/gd/gd.c 8 Oct 2006 14:11:47 -0000 @@ -4509,8 +4509,10 @@ php_image_filter_smooth }; - if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 5 || zend_parse_parameters(2 TSRMLS_CC, "rl", &tmp, &filtertype) == FAILURE) { - ZEND_WRONG_PARAM_COUNT(); + if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 5) { + WRONG_PARAM_COUNT; + } else if (zend_parse_parameters(2 TSRMLS_CC, "rl", &tmp, &filtertype) == FAILURE) { + return; } if (filtertype >= 0 && filtertype <= IMAGE_FILTER_MAX) {