Skip to content

Commit

Permalink
Update filemanager.inc.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Seeley committed Mar 19, 2016
1 parent fa75279 commit 416702f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mods/_core/file_manager/filemanager.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ function preExtractCallBack($p_event, &$p_header) {
*/
function preImportCallBack($p_event, &$p_header) {
global $IllegalExtentions;
$legalExtensions = array("txt", "xml");

if ($p_header['folder'] == 1) {
return 1;
Expand All @@ -165,8 +164,9 @@ function preImportCallBack($p_event, &$p_header) {
if (strpos($path_parts['dirname'], '..') !== false) {
return 0;
}
# we use a white list, again, we could log here
if (!in_array($ext, $legalExtentions)) {
# we should use a whitelist here instead of a blacklist,
# but the code above should stop traversal attacks at least
if (in_array($ext, $IllegalExtentions)) {
return 0;
}

Expand Down

0 comments on commit 416702f

Please sign in to comment.