Skip to content

Commit 5a53402

Browse files
committed
test: add SQLi rejection and edge-case tests for gc() type safety
1 parent e9bc894 commit 5a53402

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/system/Session/Handlers/Database/AbstractHandlerTestCase.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,11 @@ public function testGC(): void
126126

127127
public function testGCRejectsNonInt(): void
128128
{
129-
$handler = $this->getInstance();
129+
$handler = $this->getInstance();
130+
$malicious = 'malicious; DROP TABLE sessions; --';
130131

131132
$this->expectException(TypeError::class);
132-
$handler->gc('malicious; DROP TABLE sessions; --'); // @phpstan-ignore argument.type
133+
$handler->gc($malicious); // @phpstan-ignore argument.type
133134
}
134135

135136
public function testGCWithZero(): void

0 commit comments

Comments
 (0)