use realpath and validate tpl directory contents

to ensure only php files inside the tpl dir can get used as templates
This commit is contained in:
El RIDO
2025-11-11 09:34:54 +01:00
parent db251732d2
commit 83b5d1fbba
2 changed files with 22 additions and 4 deletions
+9
View File
@@ -142,4 +142,13 @@ class ViewTest extends TestCase
$this->expectExceptionCode(80);
$test->draw('123456789 does not exist!');
}
public function testInvalidTemplate()
{
$test = new View;
$this->expectException(Exception::class);
$this->expectExceptionCode(81);
$test->draw('../index');
}
}