mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix bug GH-11600: Can't parse time strings which include (narrow) non-breaking space characters
This commit is contained in:
2
NEWS
2
NEWS
@@ -21,6 +21,8 @@ PHP NEWS
|
||||
|
||||
- Date:
|
||||
. Fixed bug GH-11368 (Date modify returns invalid datetime). (Derick)
|
||||
. Fixed bug GH-11600 (Can't parse time strings which include (narrow)
|
||||
non-breaking space characters). (Derick)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug GH-11625 (DOMElement::replaceWith() doesn't replace node with
|
||||
|
||||
19
ext/date/tests/bug-gh11600.phpt
Normal file
19
ext/date/tests/bug-gh11600.phpt
Normal file
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug GH-11600: Intl patterns are not parseable DateTime Strings
|
||||
--INI--
|
||||
date.timezone=UTC
|
||||
--FILE--
|
||||
<?php
|
||||
$formatter = new IntlDateFormatter('en_US', -1, 3);
|
||||
$pattern = $formatter->getPattern();
|
||||
|
||||
$timeString = $formatter->format(strtotime('2023-07-11 16:02'));
|
||||
|
||||
$timestamp = strtotime($timeString);
|
||||
|
||||
var_dump($pattern, $timeString, $timestamp);
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(8) "h:mm a"
|
||||
string(9) "4:02 PM"
|
||||
int(1689091320)
|
||||
Reference in New Issue
Block a user