bjori           Sun Sep 10 16:32:31 2006 UTC

  Modified files:              
    /php-src/ext/date   php_date.c 
  Log:
  - date_timezone_set() needs both arguments
  - Throw exception in DateTimeZone::__construct if no arguments are passed
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.115&r2=1.116&diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.115 php-src/ext/date/php_date.c:1.116
--- php-src/ext/date/php_date.c:1.115   Tue Sep  5 12:42:25 2006
+++ php-src/ext/date/php_date.c Sun Sep 10 16:32:30 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_date.c,v 1.115 2006/09/05 12:42:25 nlopess Exp $ */
+/* $Id: php_date.c,v 1.116 2006/09/10 16:32:30 bjori Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -2001,7 +2001,7 @@
        php_date_obj     *dateobj;
        php_timezone_obj *tzobj;
 
-       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
"O|O", &object, date_ce_date, &timezone_object, date_ce_timezone) == FAILURE) {
+       if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), 
"OO", &object, date_ce_date, &timezone_object, date_ce_timezone) == FAILURE) {
                RETURN_FALSE;
        }
        dateobj = (php_date_obj *) zend_object_store_get_object(object 
TSRMLS_CC);
@@ -2131,13 +2131,13 @@
        int tz_len;
        timelib_tzinfo *tzi = NULL;
        
+       php_set_error_handling(EH_THROW, NULL TSRMLS_CC);
        if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", 
&tz, &tz_len)) {
-               php_set_error_handling(EH_THROW, NULL TSRMLS_CC);
                if (SUCCESS == timezone_initialize(&tzi, tz TSRMLS_CC)) {
                        ((php_timezone_obj *) 
zend_object_store_get_object(getThis() TSRMLS_CC))->tz = tzi;
                }
-               php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
        }
+       php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);
 }
 
 PHP_FUNCTION(timezone_name_get)

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

Reply via email to