bjori           Mon Nov  6 16:10:33 2006 UTC

  Modified files:              
    /php-src/ext/date   php_date.c 
  Log:
  Throw exception on invalid parameters in DateTime::__construct()
  #makes sure the object doesnt get initialized with bogus parameters
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.124&r2=1.125&diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.124 php-src/ext/date/php_date.c:1.125
--- php-src/ext/date/php_date.c:1.124   Wed Oct 25 12:35:16 2006
+++ php-src/ext/date/php_date.c Mon Nov  6 16:10:33 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_date.c,v 1.124 2006/10/25 12:35:16 bjori Exp $ */
+/* $Id: php_date.c,v 1.125 2006/11/06 16:10:33 bjori Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -1807,11 +1807,11 @@
        char *time_str = NULL;
        int time_str_len = 0;
        
+       php_set_error_handling(EH_THROW, NULL TSRMLS_CC);
        if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO", 
&time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
-               php_set_error_handling(EH_THROW, NULL TSRMLS_CC);
                date_initialize(zend_object_store_get_object(getThis() 
TSRMLS_CC), time_str, time_str_len, timezone_object TSRMLS_CC);
-               php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
        }
+       php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
 }
 /* }}} */
 

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

Reply via email to