mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-03-05 13:30:32 -05:00
ensure template cookie cannot be a path
This commit is contained in:
@@ -73,8 +73,11 @@ class TemplateSwitcher
|
||||
*/
|
||||
public static function getTemplate(): string
|
||||
{
|
||||
if (array_key_exists('template', $_COOKIE) && self::isTemplateAvailable($_COOKIE['template'])) {
|
||||
return $_COOKIE['template'];
|
||||
if (array_key_exists('template', $_COOKIE)) {
|
||||
$template = basename($_COOKIE['template']);
|
||||
if (self::isTemplateAvailable($template)) {
|
||||
return $template;
|
||||
}
|
||||
}
|
||||
return self::$_templateFallback;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user