BackUrl::sanitizeForLinks 增强:拒绝协议相对 URL(//evil.com)并补单测
This commit is contained in:
@@ -16,6 +16,9 @@ class BackUrlSanitizeForLinksTest extends TestCase
|
||||
{
|
||||
$this->assertSame('', BackUrl::sanitizeForLinks('https://evil.com/a'));
|
||||
$this->assertSame('', BackUrl::sanitizeForLinks('http://evil.com/a'));
|
||||
|
||||
// 协议相对 URL
|
||||
$this->assertSame('', BackUrl::sanitizeForLinks('//evil.com/a'));
|
||||
}
|
||||
|
||||
public function test_sanitize_for_links_should_reject_quotes_and_angle_brackets(): void
|
||||
|
||||
Reference in New Issue
Block a user