We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bf3ce4d + 878b8f0 commit 489d5acCopy full SHA for 489d5ac
ext/standard/tests/serialize/bug70213.phpt
@@ -0,0 +1,30 @@
1
+--TEST--
2
+Bug #70213: Unserialize context shared on double class lookup
3
+--FILE--
4
+<?php
5
+
6
+ini_set('unserialize_callback_func', 'evil');
7
8
+function evil() {
9
+ function __autoload($arg) {
10
+ var_dump(unserialize('R:1;'));
11
+ }
12
+}
13
14
+var_dump(unserialize('a:2:{i:0;i:42;i:1;O:4:"evil":0:{}}'));
15
16
+?>
17
+--EXPECTF--
18
+Notice: unserialize(): Error at offset 4 of 4 bytes in %s on line %d
19
+bool(false)
20
21
+Warning: unserialize(): Function evil() hasn't defined the class it was called for in %s on line %d
22
+array(2) {
23
+ [0]=>
24
+ int(42)
25
+ [1]=>
26
+ object(__PHP_Incomplete_Class)#1 (1) {
27
+ ["__PHP_Incomplete_Class_Name"]=>
28
+ string(4) "evil"
29
30
0 commit comments