mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
fixes GHSA-rr39-mf4j-6594 prevent displaying RAW cookie content
... and also factorize code checking the cookie.lang user input
This commit is contained in:
+1
-11
@@ -489,17 +489,7 @@ if (!isset($themeconf['hide_menu_on']) OR !in_array('thePasswordPage', $themecon
|
||||
include( PHPWG_ROOT_PATH.'include/menubar.inc.php');
|
||||
}
|
||||
|
||||
//Load language if cookie is set from login/register/password pages
|
||||
if (isset($_COOKIE['lang']) and $user['language'] != $_COOKIE['lang'])
|
||||
{
|
||||
if (!array_key_exists($_COOKIE['lang'], get_languages()))
|
||||
{
|
||||
fatal_error('[Hacking attempt] the input parameter "'.$_COOKIE['lang'].'" is not valid');
|
||||
}
|
||||
|
||||
$user['language'] = $_COOKIE['lang'];
|
||||
load_language('common.lang', '', array('language'=>$user['language']));
|
||||
}
|
||||
load_cookie_language();
|
||||
|
||||
//Get list of languages
|
||||
foreach (get_languages() as $language_code => $language_name)
|
||||
|
||||
Reference in New Issue
Block a user