mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-04-22 06:36:18 +05:30
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
|
public static function getTemplate(): string
|
||||||
{
|
{
|
||||||
if (array_key_exists('template', $_COOKIE) && self::isTemplateAvailable($_COOKIE['template'])) {
|
if (array_key_exists('template', $_COOKIE)) {
|
||||||
return $_COOKIE['template'];
|
$template = basename($_COOKIE['template']);
|
||||||
|
if (self::isTemplateAvailable($template)) {
|
||||||
|
return $template;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return self::$_templateFallback;
|
return self::$_templateFallback;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue