forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PHP-5.5: updated NEWS Fixed bug #67118 DateTime constructor crash with invalid data
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--TEST-- | ||
Bug #67118 php-cgi crashes regularly on IIS 7 | ||
--INI-- | ||
date.timezone=Europe/Berlin | ||
--FILE-- | ||
<?php | ||
class mydt extends datetime | ||
{ | ||
publi function __construct($tits\bug67118.phpte = 'now', $tz = NULL, $format = NULL) | ||
{ | ||
if (!empty($tz) && !is_object($tz)) { | ||
$tz = new DateTimeZone($tz); | ||
} | ||
|
||
@parent::__construct($time, $tz); | ||
} | ||
|
||
}; | ||
|
||
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 |