diff --git a/administrator/components/com_media/src/Controller/ApiController.php b/administrator/components/com_media/src/Controller/ApiController.php index ec5e6d11444df..a793c327b23b6 100644 --- a/administrator/components/com_media/src/Controller/ApiController.php +++ b/administrator/components/com_media/src/Controller/ApiController.php @@ -275,10 +275,10 @@ public function putFiles() $this->getModel()->updateFile($adapter, $name, str_replace($name, '', $path), $mediaContent); } - list($destinationAdapter, $destinationPath) = explode(':', $newPath, 2); - - if ($newPath != null && ($adapter !== $destinationAdapter && str_replace($destinationAdapter . ':', '', $newPath) !== $path)) + if ($newPath != null && $newPath !== $adapter . ':' . $path) { + list($destinationAdapter, $destinationPath) = explode(':', $newPath, 2); + if ($move) { $destinationPath = $this->getModel()->move($adapter, $path, $destinationPath, false);