-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/snyk report #18077
base: main
Are you sure you want to change the base?
Fix/snyk report #18077
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -717,6 +717,8 @@ private static function getTabIconClass(?string $form_itemtype = null): string | |
**/ | ||
public static function createTabEntry($text, $nb = 0, ?string $form_itemtype = null, string $icon = '') | ||
{ | ||
$text = htmlspecialchars($text); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I created a PR for this one as it requires some calls to be adapted. See #18121. |
||
|
||
if (empty($icon)) { | ||
$icon = static::getTabIconClass($form_itemtype); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,13 +168,15 @@ public static function init(Auth $auth) | |
|
||
$auth->user->computePreferences(); | ||
foreach ($CFG_GLPI['user_pref_field'] as $field) { | ||
if ($field == 'language' && isset($_POST['language']) && $_POST['language'] != '') { | ||
$_SESSION["glpi$field"] = $_POST[$field]; | ||
} else if (isset($auth->user->fields[$field])) { | ||
if (isset($auth->user->fields[$field])) { | ||
$_SESSION["glpi$field"] = $auth->user->fields[$field]; | ||
} | ||
} | ||
|
||
if (isset($_POST['language']) && $_POST['language'] != '' && isset($CFG_GLPI['languages'][$_POST['language']])) { | ||
$_SESSION["glpilanguage"] = $_POST['language']; | ||
} | ||
Comment on lines
+176
to
+178
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess the purpose of this is to be able to display a confirmation message in the target language when the user uses the language switch feature. This can probably be done in It would prevent side effects, for instance when the |
||
|
||
if (isset($_SESSION['glpidefault_central_tab']) && $_SESSION['glpidefault_central_tab']) { | ||
Session::setActiveTab("central", "Central$" . $_SESSION['glpidefault_central_tab']); | ||
} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can even drop the |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should always use
getItemForItemtype()
to instanciate classes from a dynamic classname.