mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-01-23 02:35:23 +00:00
ensure template cookie cannot be a path
This commit is contained in:
parent
a371f5cab5
commit
f456fb576e
1 changed files with 5 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue