Skip to content

Commit

Permalink
Documents: Move form, add remove_xss
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Aug 2, 2021
1 parent f539afe commit 78f74d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main/document/document.php
Expand Up @@ -1090,7 +1090,7 @@ function convertModal (id, format) {
false,
$curdirpath
);
$moveForm .= '<legend>'.get_lang('Move').': '.$document_to_move['title'].'</legend>';
$moveForm .= '<legend>'.get_lang('Move').': '.Security::remove_XSS($document_to_move['title']).'</legend>';

// filter if is my shared folder. TODO: move this code to build_move_to_selector function
if (DocumentManager::is_my_shared_folder(api_get_user_id(), $curdirpath, $sessionId) &&
Expand Down
3 changes: 2 additions & 1 deletion main/inc/lib/document.lib.php
Expand Up @@ -5049,7 +5049,7 @@ public static function build_directory_selector(

if (is_array($folders)) {
$escaped_folders = [];
foreach ($folders as $key => &$val) {
foreach ($folders as $key => $val) {
$escaped_folders[$key] = Database::escape_string($val);
}
$folder_sql = implode("','", $escaped_folders);
Expand Down Expand Up @@ -5097,6 +5097,7 @@ public static function build_directory_selector(
} else {
$label = ' &mdash; '.$folder_titles[$folder];
}
$label = Security::remove_XSS($label);
$parent_select->addOption($label, $folder_id);
if ($selected != '') {
$parent_select->setSelected($folder_id);
Expand Down

0 comments on commit 78f74d3

Please sign in to comment.