From f2ad985262ed01eec29d90eab2eb0958089fc8c8 Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Sun, 10 Sep 2006 16:32:30 +0000 Subject: [PATCH] - date_timezone_set() needs both arguments - Throw exception in DateTimeZone::__construct if no arguments are passed --- ext/date/php_date.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 4c101610133..e56406887d1 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2001,7 +2001,7 @@ PHP_FUNCTION(date_timezone_set) 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 @@ PHP_METHOD(DateTimeZone, __construct) 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)