Skip to content

Commit 4de5af0

Browse files
committed
simplified
Signed-off-by: dgrammatiko <[email protected]>
1 parent 43c068b commit 4de5af0

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

plugins/filesystem/local/src/Adapter/LocalAdapter.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -961,22 +961,13 @@ private function getLocalPath(string $path): string
961961
*/
962962
private function getLocalThumbPaths(string $path): array
963963
{
964-
$normalizeDirectorySeparator = ['\\', '/', ':'];
964+
$rootPath = str_replace(['\\', '/'], '/', $this->rootPath);
965+
$path = str_replace(['\\', '/'], '/', $path);
965966

966967
try
967968
{
968-
$fs = Path::check(
969-
str_replace(
970-
str_replace($normalizeDirectorySeparator, '/', $this->rootPath),
971-
JPATH_ROOT . '/media/cache/com_media/thumbs/' . $this->filePath,
972-
str_replace($normalizeDirectorySeparator, '/', $path)
973-
)
974-
);
975-
$url = str_replace(
976-
str_replace($normalizeDirectorySeparator, '/', $this->rootPath),
977-
'media/cache/com_media/thumbs/' . $this->filePath,
978-
str_replace($normalizeDirectorySeparator, '/', $path)
979-
);
969+
$fs = Path::check(str_replace($rootPath, JPATH_ROOT . '/media/cache/com_media/thumbs/' . $this->filePath, $path));
970+
$url = str_replace($rootPath, 'media/cache/com_media/thumbs/' . $this->filePath, $path);
980971

981972
return [
982973
'fs' => $fs,

0 commit comments

Comments
 (0)