Skip to content

Commit

Permalink
Prevent XSS on browse views
Browse files Browse the repository at this point in the history
  • Loading branch information
orthagh authored and trasher committed Jan 24, 2023
1 parent 7b3704c commit 902e783
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 3 additions & 9 deletions src/Features/TreeBrowse.php
Expand Up @@ -62,15 +62,9 @@ public static function showBrowseView(string $itemtype, array $params, $update =

$ajax_url = $CFG_GLPI["root_doc"] . "/ajax/treebrowse.php";
$loading_txt = __s('Loading...');
$start = isset($params['start'])
? $params['start']
: 0;
$browse = isset($params['browse'])
? $params['browse']
: 0;
$is_deleted = isset($params['is_deleted'])
? $params['is_deleted']
: 0;
$start = (int)($_REQUEST['start'] ?? 0);
$browse = (int)($_REQUEST['browse'] ?? 0);
$is_deleted = (int)($_REQUEST['is_deleted'] ?? 0);
$criteria = json_encode($params['criteria']);

$category_list = json_encode(self::getTreeCategoryList($itemtype, $params));
Expand Down
4 changes: 1 addition & 3 deletions src/Knowbase.php
Expand Up @@ -151,9 +151,7 @@ public static function showBrowseView()
$rand = mt_rand();
$ajax_url = $CFG_GLPI["root_doc"] . "/ajax/knowbase.php";
$loading_txt = __s('Loading...');
$start = isset($_REQUEST['start'])
? $_REQUEST['start']
: 0;
$start = (int)($_REQUEST['start'] ?? 0);

$category_list = json_encode(self::getTreeCategoryList());
$no_cat_found = __s("No category found");
Expand Down

0 comments on commit 902e783

Please sign in to comment.