Skip to content

Commit 68a3c70

Browse files
author
tolanych
committed
add sanitize two dots in filepath for file uploading
1 parent af48a7c commit 68a3c70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: core/model/modx/sources/modfilemediasource.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ public function uploadObjectsToContainer($container,array $objects = array()) {
873873
}
874874

875875
$newPath = $this->fileHandler->sanitizePath($file['name']);
876-
$newPath = $directory->getPath().$newPath;
876+
$newPath = ltrim(strip_tags(preg_replace('/[\.]{2,}/', '', htmlspecialchars($directory->getPath().$newPath))));
877877

878878
if (!move_uploaded_file($file['tmp_name'],$newPath)) {
879879
$this->addError('path',$this->xpdo->lexicon('file_err_upload'));

0 commit comments

Comments
 (0)