Skip to content

Commit

Permalink
Fix warning for Media Form Field with window directory separate in value
Browse files Browse the repository at this point in the history
  • Loading branch information
joomdonation committed Nov 19, 2022
1 parent 06038e5 commit e2daf12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libraries/src/Form/Field/MediaField.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\Helper\MediaHelper;
use Joomla\CMS\Uri\Uri;
Expand Down Expand Up @@ -286,7 +287,7 @@ public function getLayoutData()
* the top level folder is one of the directory configured in filesystem local plugin to avoid error message
* displayed in manage when users click on Select button to select a new image
*/
$paths = explode('/', $this->value);
$paths = explode('/', Path::clean($this->value, '/'));

// Remove filename from $paths array
array_pop($paths);
Expand Down

0 comments on commit e2daf12

Please sign in to comment.