mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-04-18 21:48:24 -04:00
partially revert #1559
Instead of automatically adding custom templates, we log an error if that template is missing in the available templates. Still mitigates arbitrary file inclusion, as the string is now checked against a fixed allow list.
This commit is contained in:
@@ -141,20 +141,4 @@ class ViewTest extends TestCase
|
||||
$this->expectExceptionCode(80);
|
||||
$test->draw('123456789 does not exist!');
|
||||
}
|
||||
|
||||
public function testTemplateFilePath()
|
||||
{
|
||||
$template = 'bootstrap';
|
||||
$templatePath = PATH . 'tpl' . DIRECTORY_SEPARATOR . $template . '.php';
|
||||
$path = View::getTemplateFilePath($template);
|
||||
$this->assertEquals($templatePath, $path, 'Template file path');
|
||||
}
|
||||
|
||||
public function testIsBootstrapTemplate()
|
||||
{
|
||||
$bootstrapTemplate = 'bootstrap-dark';
|
||||
$nonBootstrapTemplate = 'bootstrap5';
|
||||
$this->assertTrue(View::isBootstrapTemplate($bootstrapTemplate), 'Is bootstrap template');
|
||||
$this->assertFalse(View::isBootstrapTemplate($nonBootstrapTemplate), 'Is not bootstrap template');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user