Skip to content

Commit 1b13ff6

Browse files
committed
Add XFAIL test for bug #62852
1 parent e766f85 commit 1b13ff6

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

NEWS

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ PHP NEWS
3737
- CURL:
3838
. Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick)
3939

40-
- DateTime:
41-
. Fixed bug #62852 (Unserialize invalid DateTime causes crash).
42-
43-
4440
- Intl:
4541
. Fix null pointer dereferences in some classes of ext/intl. (Gustavo)
4642

ext/date/tests/bug62852.phpt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
--TEST--
2+
Bug #62852 (Unserialize invalid DateTime causes crash)
3+
--INI--
4+
date.timezone=GMT
5+
--XFAIL--
6+
bug is not fixed yet
7+
--FILE--
8+
<?php
9+
$s1 = 'O:8:"DateTime":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}';
10+
$s2 = 'O:3:"Foo":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}';
11+
12+
global $foo;
13+
14+
class Foo extends DateTime {
15+
function __wakeup() {
16+
global $foo;
17+
$foo = $this;
18+
parent::__wakeup();
19+
}
20+
}
21+
22+
// Old test case
23+
try {
24+
unserialize( $s1 );
25+
} catch ( Exception $e ) {}
26+
27+
// My test case
28+
try {
29+
unserialize( $s2 );
30+
} catch ( Exception $e ) {}
31+
var_dump( $foo );
32+
?>
33+
--EXPECTF--

0 commit comments

Comments
 (0)