Apply fixes from StyleCI
[ci skip] [skip ci]
This commit is contained in:
parent
bfbbf89d79
commit
fbcdc8f20e
1 changed files with 14 additions and 10 deletions
|
@ -41,8 +41,10 @@ class MediaController extends Controller
|
|||
): Response {
|
||||
$media = $this->getMedia($userCode, $mediaCode, true);
|
||||
|
||||
if (!$media || (!$media->published && $this->session->get('user_id') !== $media->user_id && !$this->session->get('admin',
|
||||
false))) {
|
||||
if (!$media || (!$media->published && $this->session->get('user_id') !== $media->user_id && !$this->session->get(
|
||||
'admin',
|
||||
false
|
||||
))) {
|
||||
throw new HttpNotFoundException($request);
|
||||
}
|
||||
|
||||
|
@ -131,9 +133,9 @@ class MediaController extends Controller
|
|||
$media = $this->getMedia($userCode, $mediaCode, false);
|
||||
|
||||
if (!$media || (!$media->published && $this->session->get('user_id') !== $media->user_id && !$this->session->get(
|
||||
'admin',
|
||||
false
|
||||
))) {
|
||||
'admin',
|
||||
false
|
||||
))) {
|
||||
throw new HttpNotFoundException($request);
|
||||
}
|
||||
|
||||
|
@ -165,9 +167,9 @@ class MediaController extends Controller
|
|||
$media = $this->getMedia($userCode, $mediaCode, false);
|
||||
|
||||
if (!$media || (!$media->published && $this->session->get('user_id') !== $media->user_id && !$this->session->get(
|
||||
'admin',
|
||||
false
|
||||
))) {
|
||||
'admin',
|
||||
false
|
||||
))) {
|
||||
throw new HttpNotFoundException($request);
|
||||
}
|
||||
|
||||
|
@ -370,8 +372,10 @@ class MediaController extends Controller
|
|||
$this->session->close();
|
||||
$mime = $storage->getMimetype($media->storage_path);
|
||||
|
||||
if ((param($request, 'width') !== null || param($request, 'height') !== null) && explode('/',
|
||||
$mime)[0] === 'image') {
|
||||
if ((param($request, 'width') !== null || param($request, 'height') !== null) && explode(
|
||||
'/',
|
||||
$mime
|
||||
)[0] === 'image') {
|
||||
return $this->makeThumbnail(
|
||||
$storage,
|
||||
$media,
|
||||
|
|
Loading…
Reference in a new issue