BackUrl::sanitizeForLinks 增加长度安全阀(>2000 拒绝)并补单测
This commit is contained in:
@@ -12,6 +12,12 @@ class BackUrlSanitizeForLinksTest extends TestCase
|
||||
$this->assertSame('/admin/platform-orders', BackUrl::sanitizeForLinks('/admin/platform-orders'));
|
||||
}
|
||||
|
||||
public function test_sanitize_for_links_should_reject_too_long_back(): void
|
||||
{
|
||||
$long = '/admin/x?' . str_repeat('a', 5000);
|
||||
$this->assertSame('', BackUrl::sanitizeForLinks($long));
|
||||
}
|
||||
|
||||
public function test_sanitize_for_links_should_reject_absolute_urls(): void
|
||||
{
|
||||
$this->assertSame('', BackUrl::sanitizeForLinks('https://evil.com/a'));
|
||||
|
||||
Reference in New Issue
Block a user