mirror of
https://github.com/php/php-src.git
synced 2024-09-30 22:36:12 +00:00
Merge branch 'PHP-5.6'
* PHP-5.6: NEWS NEWS NEWS Fix regression introduce in fix for bug #67118
This commit is contained in:
commit
2890284096
@ -2582,6 +2582,8 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
|
||||
err->error_messages[0].position, err->error_messages[0].character, err->error_messages[0].message);
|
||||
}
|
||||
if (err && err->error_count) {
|
||||
timelib_time_dtor(dateobj->time);
|
||||
dateobj->time = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2729,9 +2731,7 @@ PHP_METHOD(DateTime, __construct)
|
||||
|
||||
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
|
||||
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
|
||||
if (!php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC)) {
|
||||
ZVAL_NULL(getThis());
|
||||
}
|
||||
php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC);
|
||||
}
|
||||
zend_restore_error_handling(&error_handling TSRMLS_CC);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
Bug #67118 php-cgi crashes regularly on IIS 7
|
||||
Bug #67118 crashes in DateTime when this used after failed __construct
|
||||
--INI--
|
||||
date.timezone=Europe/Berlin
|
||||
--FILE--
|
||||
@ -11,17 +11,17 @@ class mydt extends datetime
|
||||
if (!empty($tz) && !is_object($tz)) {
|
||||
$tz = new DateTimeZone($tz);
|
||||
}
|
||||
|
||||
@parent::__construct($time, $tz);
|
||||
try {
|
||||
@parent::__construct($time, $tz);
|
||||
} catch (Exception $e) {
|
||||
echo "Bad date" . $this->format("Y") . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
new mydt("Funktionsansvarig rådgivning och juridik", "UTC");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (Funktionsansvarig rådgivning och juridik) at position 0 (F): The timezone could not be found in the database' in %sbug67118.php:%d
|
||||
Stack trace:
|
||||
#0 %sbug67118.php(%d): DateTime->__construct('Funktionsansvar...', Object(DateTimeZone))
|
||||
#1 %sbug67118.php(%d): mydt->__construct('Funktionsansvar...', 'UTC')
|
||||
#2 {main}
|
||||
thrown in %sbug67118.php on line %d
|
||||
Warning: DateTime::format(): The DateTime object has not been correctly initialized by its constructor in %sbug67118.php on line %d
|
||||
Bad date
|
||||
|
Loading…
Reference in New Issue
Block a user