Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Handle a custom path in FileSelector::convertValuesToPaths() (see #8562
Browse files Browse the repository at this point in the history
…).
  • Loading branch information
leofeyer committed Nov 15, 2016
1 parent 544a6be commit 7a2edc6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion system/modules/core/widgets/FileSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ protected function convertValuesToPaths()
}

// TinyMCE will pass the path instead of the ID
if (strncmp($this->varValue[0], \Config::get('uploadPath') . '/', strlen(\Config::get('uploadPath')) + 1) === 0)
if (strpos($this->varValue[0], \Config::get('uploadPath') . '/') === 0)
{
return;
}
Expand All @@ -462,6 +462,12 @@ protected function convertValuesToPaths()
return;
}

// Return if the custom path is not within the upload path (see #8562)
if ($this->path != '' && strpos($this->path, \Config::get('uploadPath') . '/') !== 0)
{
return;
}

$objFiles = \FilesModel::findMultipleByIds($this->varValue);

if ($objFiles !== null)
Expand Down

0 comments on commit 7a2edc6

Please sign in to comment.