helly           Thu Dec  5 07:39:01 2002 EDT

  Modified files:              
    /php4/ext/standard  image.c 
  Log:
  Return FALSE on error as mentioned by John Coggeshall.
  See Bug #20822
  
  
Index: php4/ext/standard/image.c
diff -u php4/ext/standard/image.c:1.77 php4/ext/standard/image.c:1.78
--- php4/ext/standard/image.c:1.77      Tue Nov 19 16:24:47 2002
+++ php4/ext/standard/image.c   Thu Dec  5 07:39:00 2002
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: image.c,v 1.77 2002/11/19 21:24:47 iliaa Exp $ */
+/* $Id: image.c,v 1.78 2002/12/05 12:39:00 helly Exp $ */
 
 #include "php.h"
 #include <stdio.h>
@@ -825,6 +825,7 @@
        int arg_c = ZEND_NUM_ARGS();
 
        if ((arg_c!=1) || zend_get_parameters_ex(arg_c, &p_image_type) == FAILURE) {
+               RETVAL_FALSE;
                WRONG_PARAM_COUNT;
        }
        convert_to_long_ex(p_image_type);
@@ -896,6 +897,7 @@
 
        case 1:
                if (zend_get_parameters_ex(1, &arg1) == FAILURE) {
+                       RETVAL_FALSE;
                        WRONG_PARAM_COUNT;
                }
                convert_to_string_ex(arg1);
@@ -903,20 +905,21 @@
 
        case 2:
                if (zend_get_parameters_ex(2, &arg1, &info) == FAILURE) {
+                       RETVAL_FALSE;
                        WRONG_PARAM_COUNT;
                }
                zval_dtor(*info);
 
                if (array_init(*info) == FAILURE) {
-                       return;
+                       RETURN_FALSE;
                }
 
                convert_to_string_ex(arg1);
                break;
 
        default:
+               RETVAL_FALSE;
                WRONG_PARAM_COUNT;
-               break;
        }
 
        stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb", 
REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE, NULL);
@@ -976,7 +979,7 @@
                if (array_init(return_value) == FAILURE) {
                        php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to 
initialize array");
                        efree(result);
-                       return;
+                       RETURN_FALSE;
                }
                add_index_long(return_value, 0, result->width);
                add_index_long(return_value, 1, result->height);



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

Reply via email to