Navigation Menu

Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-mw committed Dec 5, 2022
1 parent babf280 commit 0d279ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 14 additions & 0 deletions src/MicroweberPackages/App/functions/other.php
Expand Up @@ -1211,3 +1211,17 @@ function mergeScreenshotParts($files, $outputFilename = 'full-screenshot.png')
imagepng($targetImage, $outputFilename, 8);
}
}
if (!function_exists('sanitize_path')) {

function sanitize_path($path)
{
$path = str_replace('..', '', $path);
$path = str_replace('./', '', $path);
$path = str_replace('.\\', '', $path);
$path = str_replace(';', '', $path);
$path = str_replace('&&', '', $path);
$path = str_replace('|', '', $path);
$path = str_replace('>', '', $path);
return $path;
}
}
3 changes: 1 addition & 2 deletions src/MicroweberPackages/App/functions/plupload.php
Expand Up @@ -285,8 +285,7 @@
//$path = str_replace('%25252F','/',$path);

$path = normalize_path($path, 0);

$path = str_replace('..', '', $path);
$path = sanitize_path($path);
$path = str_replace($path_restirct, '', $path);

// $target_path = userfiles_path() . DS . $path;
Expand Down

0 comments on commit 0d279ac

Please sign in to comment.