From 2b9eedfdb85979c16a290af99feb5827e1f34894 Mon Sep 17 00:00:00 2001 From: Jim Safley Date: Thu, 13 Jun 2024 13:21:10 -0400 Subject: [PATCH] Fix strpos deprecation notice (cherry picked from commit e0a284a78af56d314813e55bcbfdac259d594d27) --- application/src/View/Helper/LightGalleryOutput.php | 2 +- application/src/View/Helper/SortMedia.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/src/View/Helper/LightGalleryOutput.php b/application/src/View/Helper/LightGalleryOutput.php index b711e8837..4443d1cdc 100644 --- a/application/src/View/Helper/LightGalleryOutput.php +++ b/application/src/View/Helper/LightGalleryOutput.php @@ -34,7 +34,7 @@ public function __invoke($files = null) ]; $mediaCaptionAttribute = ($mediaCaption) ? $mediaCaptionOptions[$mediaCaption] : ''; $mediaType = $media->mediatype(); - if (strpos($mediaType, 'video') !== false) { + if (null !== $mediaType && strpos($mediaType, 'video') !== false) { $videoSrcObject = [ 'source' => [ [ diff --git a/application/src/View/Helper/SortMedia.php b/application/src/View/Helper/SortMedia.php index 3a44d15fc..d62b0b3b3 100644 --- a/application/src/View/Helper/SortMedia.php +++ b/application/src/View/Helper/SortMedia.php @@ -18,7 +18,7 @@ public function __invoke($files = null) $mediaRenderer = $media->renderer(); if (in_array($mediaType, $whitelist) || (strpos($mediaRenderer, 'youtube') !== false)) { $sortedMedia['lightMedia'][$mediaCount]['media'] = $media; - if (strpos($mediaType, 'video') !== false) { + if (null !== $mediaType && strpos($mediaType, 'video') !== false) { $html5videos[$mediaCount] = pathinfo($media->source(), PATHINFO_FILENAME); $sortedMedia['lightMedia'][$mediaCount]['tracks'] = []; }