File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ public function getHtml(): string
2828 }
2929 $ sanitize = $ this ->sanitize + $ sanitize ;
3030 foreach ($ sanitize as $ search => $ replace ) {
31+ $ search = (string )$ search ;
3132 $ replacements [$ search ] = $ replace ;
3233 $ replacements [urlencode ($ search )] = $ replace ;
3334 }
Original file line number Diff line number Diff line change @@ -76,6 +76,23 @@ class PhpInfoTest extends TestCase
7676 Assert::contains (self ::WALDO_1338 , $ html );
7777 }
7878
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+
7996}
8097
8198(new PhpInfoTest ())->run ();
You can’t perform that action at this time.
0 commit comments