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 dae5f7fd61
commit f2164353c3
2 changed files with 22 additions and 4 deletions
+9
View File
@@ -141,4 +141,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');
}
}