From b95bc398fd5f9beec328f81524d12484543add8d Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 31 Jul 2020 18:13:52 +0200 Subject: [PATCH] inspection fixes --- Controller/ApiController.php | 10 +++++----- Controller/BackendController.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Controller/ApiController.php b/Controller/ApiController.php index ece1222..bd328c0 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -429,7 +429,7 @@ final class ApiController extends Controller $mediaCollection->addSource(new NullMedia((int) $file)); } - $virtualPath = \urldecode((string) ($request->getData('virtualpath') ?? '/')); + $virtualPath = \urldecode((string) ($request->getData('virtualpath') ?? '/')); $outputDir = ''; if (empty($request->getData('path'))) { @@ -502,10 +502,10 @@ final class ApiController extends Controller */ public function apiMediaCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : void { - $path = \urldecode((string) ($request->getData('path') ?? '')); - $virtualPath = \urldecode((string) ($request->getData('virtualpath') ?? '')); - $fileName = (string) ($request->getData('fileName') ?? ($request->getData('name') ?? '')); - $fileName .= \strripos($fileName, '.') === false ? '.txt' : ''; + $path = \urldecode((string) ($request->getData('path') ?? '')); + $virtualPath = \urldecode((string) ($request->getData('virtualpath') ?? '')); + $fileName = (string) ($request->getData('fileName') ?? ($request->getData('name') ?? '')); + $fileName .= \strripos($fileName, '.') === false ? '.txt' : ''; $outputDir = ''; if (empty($request->getData('path'))) { diff --git a/Controller/BackendController.php b/Controller/BackendController.php index de85207..157bf57 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -146,7 +146,7 @@ final class BackendController extends Controller /** @var string[] $glob */ $glob = $collection->isAbsolute() ? $collection->getPath() . '/' . $collection->getName() . '/*' - : \glob(__DIR__ . '/../Files' . '/' . \rtrim($collection->getPath(), '/') . '/' . $collection->getName() . '/*'); + : \glob(__DIR__ . '/../Files/' . \rtrim($collection->getPath(), '/') . '/' . $collection->getName() . '/*'); $glob = $glob === false ? [] : $glob; foreach ($glob as $file) {