Skip to content

Commit cc4e958

Browse files
committed
Merge branch 'PHP-8.2'
2 parents 61cf7d4 + f340854 commit cc4e958

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

ext/date/lib/parse_date.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by re2c 0.15.3 on Thu Dec 1 10:59:46 2022 */
1+
/* Generated by re2c 0.15.3 on Tue Jan 10 15:16:26 2023 */
22
#line 1 "ext/date/lib/parse_date.re"
33
/*
44
* The MIT License (MIT)
@@ -787,7 +787,7 @@ static timelib_long timelib_lookup_abbr(const char **ptr, int *dst, char **tz_ab
787787
(**ptr >= 'A' && **ptr <= 'Z') ||
788788
(**ptr >= 'a' && **ptr <= 'z') ||
789789
(**ptr >= '0' && **ptr <= '9') ||
790-
**ptr == '/' || **ptr == '_' || **ptr == '-'
790+
**ptr == '/' || **ptr == '_' || **ptr == '-' || **ptr == '+'
791791
) {
792792
++*ptr;
793793
}

ext/date/lib/parse_date.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ static timelib_long timelib_lookup_abbr(const char **ptr, int *dst, char **tz_ab
785785
(**ptr >= 'A' && **ptr <= 'Z') ||
786786
(**ptr >= 'a' && **ptr <= 'z') ||
787787
(**ptr >= '0' && **ptr <= '9') ||
788-
**ptr == '/' || **ptr == '_' || **ptr == '-'
788+
**ptr == '/' || **ptr == '_' || **ptr == '-' || **ptr == '+'
789789
) {
790790
++*ptr;
791791
}

ext/date/tests/gh10218.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
Bug GH-10218 (DateTimeZone fails to parse time zones that contain the "+" character)
3+
--FILE--
4+
<?php
5+
var_dump(new DateTime('now', new DateTimeZone('Etc/GMT+1')));
6+
?>
7+
--EXPECTF--
8+
object(DateTime)#%d (%d) {
9+
["date"]=>
10+
string(%d) "%s"
11+
["timezone_type"]=>
12+
int(3)
13+
["timezone"]=>
14+
string(9) "Etc/GMT+1"
15+
}

0 commit comments

Comments
 (0)