From b9ce53475351cdde9ddd89da88bb8cd0db03fb14 Mon Sep 17 00:00:00 2001
From: Tim <162806658+timotei-litespeed@users.noreply.github.com>
Date: Tue, 14 Jan 2025 22:14:41 +0200
Subject: [PATCH] Media Class - Fix warning (#790)
* Media Class - Fix warning
Fix PHP 8.1, 8.2 warnings. Ticket #878893
* Fix coding
---
src/media.cls.php | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/media.cls.php b/src/media.cls.php
index f599cbb2b..eec54edff 100644
--- a/src/media.cls.php
+++ b/src/media.cls.php
@@ -649,8 +649,15 @@ private function _parse_img_for_preload()
if (!$vpi_files) {
return;
}
+ if(!$this->content) {
+ return;
+ }
$content = preg_replace(array('##sU', '##isU'), '', $this->content);
+ if(!$content) {
+ return;
+ }
+
preg_match_all('#]+)/?>#isU', $content, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
$attrs = Utility::parse_attr($match[1]);