inspection fixes

This commit is contained in:
Dennis Eichhorn 2020-07-31 18:13:52 +02:00
parent 601fdf7567
commit b95bc398fd
2 changed files with 6 additions and 6 deletions

View File

@ -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'))) {

View File

@ -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) {