Skip to content

Commit

Permalink
respect the images root folder
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed Apr 2, 2017
1 parent 06dd566 commit af9b542
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions plugins/editors/tinymce/tinymce.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,10 @@ public function onDisplay($name, $content, $width, $height, $col, $row, $buttons
// Get specific path
$tempPath = $levelParams->get('path', '');

if ($tempPath === '-1')
if (!empty($tempPath) && $tempPath !== '-1')
{
$tempPath = '';
// Remove the root images path
$tempPath = str_replace(JComponentHelper::getParams('com_media')->get('image_path') . '/', '', $tempPath);
}

JText::script('PLG_TINY_ERR_UNSUPPORTEDBROWSER');
Expand Down Expand Up @@ -1869,10 +1870,10 @@ private function onDisplayLegacy($name, $content, $width, $height, $col, $row, $
// Get specific path
$tempPath = $this->params->get('path', '');

if (!empty($tempPath))
if (!empty($tempPath) && $tempPath !== '-1')
{
$tempPath = rtrim($tempPath, '/');
$tempPath = ltrim($tempPath, '/');
// Remove the root images path
$tempPath = str_replace(JComponentHelper::getParams('com_media')->get('image_path') . '/', '', $tempPath);
}

JText::script('PLG_TINY_ERR_UNSUPPORTEDBROWSER');
Expand Down

0 comments on commit af9b542

Please sign in to comment.