File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ public function getHtml(): string
28
28
}
29
29
$ sanitize = $ this ->sanitize + $ sanitize ;
30
30
foreach ($ sanitize as $ search => $ replace ) {
31
+ $ search = (string )$ search ;
31
32
$ replacements [$ search ] = $ replace ;
32
33
$ replacements [urlencode ($ search )] = $ replace ;
33
34
}
Original file line number Diff line number Diff line change @@ -76,6 +76,23 @@ class PhpInfoTest extends TestCase
76
76
Assert::contains (self ::WALDO_1338 , $ html );
77
77
}
78
78
79
+
80
+ public function testGetHtmlNumericSessionId (): void
81
+ {
82
+ $ sessionId = '31337 ' ;
83
+ $ _COOKIE ['PHPSESSID ' ] = $ sessionId ;
84
+
85
+ // Set a new session id
86
+ session_destroy ();
87
+ session_set_save_handler (new TestSessionHandler ($ sessionId ));
88
+ session_start ();
89
+
90
+ Assert::noError (function () use ($ sessionId , &$ html ): void {
91
+ $ html = (new PhpInfo ())->getHtml ();
92
+ });
93
+ Assert::notContains ($ sessionId , $ html );
94
+ }
95
+
79
96
}
80
97
81
98
(new PhpInfoTest ())->run ();
You can’t perform that action at this time.
0 commit comments