Procházet zdrojové kódy

prevent use of paths in template names, only file names inside tpl directory are allowed

El RIDO před 8 měsíci
rodič
revize
4ac8ffa2a4
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      lib/View.php

+ 1 - 1
lib/View.php

@@ -66,7 +66,7 @@ class View
      */
     public static function getTemplateFilePath(string $template): string
     {
-        $file = self::isBootstrapTemplate($template) ? 'bootstrap' : $template;
+        $file = self::isBootstrapTemplate($template) ? 'bootstrap' : basename($template);
         return PATH . 'tpl' . DIRECTORY_SEPARATOR . $file . '.php';
     }