From da455933ddfce56752d2ff04980e57e216f55201 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 21 May 2018 22:30:04 +0200 Subject: [PATCH] Remove whitespace --- Theme/Backend/media-list.tpl.php | 4 ++-- Views/MediaView.php | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Theme/Backend/media-list.tpl.php b/Theme/Backend/media-list.tpl.php index a2fba10..94f5bc8 100644 --- a/Theme/Backend/media-list.tpl.php +++ b/Theme/Backend/media-list.tpl.php @@ -35,8 +35,8 @@ echo $this->getData('nav')->render(); ?> getHtml('Creator') ?> getHtml('Created') ?> - $value) : + $value) : $count++; $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/media/single?{?}&id=' . $value->getId()); $icon = $fileIconFunction(\phpOMS\System\File\FileUtils::getExtensionType($value->getExtension())); diff --git a/Views/MediaView.php b/Views/MediaView.php index fa74759..26eb0a6 100644 --- a/Views/MediaView.php +++ b/Views/MediaView.php @@ -36,21 +36,21 @@ class MediaView extends View { if (is_file($media->getPath() . $sub) && StringUtils::startsWith( - str_replace('\\', '/', realpath($media->getPath() . $sub)), + str_replace('\\', '/', realpath($media->getPath() . $sub)), $media->getPath() ) ) { return $media->getPath() . $sub; } - + return $media->getPath(); } protected function dirPathFunction(Media $media, string $sub) : string { - if (is_dir($media->getPath() . $sub) + if (is_dir($media->getPath() . $sub) && StringUtils::startsWith( - str_replace('\\', '/', realpath($media->getPath() . $sub)), + str_replace('\\', '/', realpath($media->getPath() . $sub)), $media->getPath() ) ) { @@ -63,7 +63,7 @@ class MediaView extends View protected function isCollectionFunction(Media $media, string $sub) : bool { return ($media->getExtension() === 'collection' - && !is_file($media->getPath() . $sub)) + && !is_file($media->getPath() . $sub)) || (is_dir($media->getPath()) && ($sub === null || is_dir($media->getPath() . $sub)) ); @@ -79,7 +79,7 @@ class MediaView extends View protected function isImageFunction(Media $media, string $path) : bool { - return FileUtils::getExtensionType($media->getExtension()) === ExtensionType::IMAGE + return FileUtils::getExtensionType($media->getExtension()) === ExtensionType::IMAGE || FileUtils::getExtensionType(File::extension($path)) === ExtensionType::IMAGE; } }