mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-04-24 22:45:10 -04:00
prefer DirectoryIterator for readability, also test jbo translation, log deletion errors
This commit is contained in:
+3
-4
@@ -67,10 +67,9 @@ class ViewTest extends TestCase
|
||||
$page->assign('CSPHEADER', 'default-src \'none\'');
|
||||
$page->assign('SRI', array());
|
||||
|
||||
$dir = dir(PATH . 'tpl');
|
||||
while (false !== ($file = $dir->read())) {
|
||||
if (substr($file, -4) === '.php') {
|
||||
$template = substr($file, 0, -4);
|
||||
foreach (new DirectoryIterator(PATH . 'tpl') as $file) {
|
||||
if ($file->getExtension() === 'php') {
|
||||
$template = $file->getBasename('.php');
|
||||
ob_start();
|
||||
$page->draw($template);
|
||||
$this->_content[$template] = ob_get_contents();
|
||||
|
||||
Reference in New Issue
Block a user