-
-
Save voku/70f46ef50c84b39e1c29ec3e0c4a3d56 to your computer and use it in GitHub Desktop.
tests for the open redirect issue (tests/Utf8/BootupTest.php)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
/** | |
* @covers Patchwork\Utf8\Bootup::filterRequestUri | |
*/ | |
public function testFilterRequestUri() | |
{ | |
// .... | |
// --- | |
$_SERVER['REQUEST_URI'] = '//google.com/%c0%af'; | |
$u = Bootup::filterRequestUri(null, false); | |
static::assertSame('/google.com/%C0%AF', $u); | |
// --- | |
$_SERVER['REQUEST_URI'] = '////google.com/%c0%af'; | |
$u = Bootup::filterRequestUri(null, false); | |
static::assertSame('/google.com/%C0%AF', $u); | |
// --- | |
$_SERVER['REQUEST_URI'] = '/%c0%af/google.com/%c0%af'; | |
$u = Bootup::filterRequestUri(null, false); | |
static::assertSame('/%C0%AF/google.com/%C0%AF', $u); | |
// --- | |
$_SERVER['REQUEST_URI'] = '%22http%3a%2f%2f | |
www.badplace.com%2fnasty.js%22%3e%3c%2fscript%3e&%C0%AF'; | |
$u = Bootup::filterRequestUri(null, false); | |
static::assertSame('%22http%3a%2f%2f | |
www.badplace.com%2fnasty.js%22%3e%3c%2fscript%3e&%C0%AF', $u); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment