From: Hannes Magnusson Date: Sun, 10 Sep 2006 16:32:30 +0000 (+0000) Subject: - date_timezone_set() needs both arguments X-Git-Tag: RELEASE_1_0_0RC1~1713 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2ad985262ed01eec29d90eab2eb0958089fc8c8;p=php - date_timezone_set() needs both arguments - Throw exception in DateTimeZone::__construct if no arguments are passed --- diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 4c10161013..e56406887d 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)