From 667528d5b927f0f284a067b0e24c9ca7f26c28a4 Mon Sep 17 00:00:00 2001 From: wn_ Date: Sat, 23 Nov 2024 18:23:49 +0000 Subject: Use PHP 8 'str_' functions. A few more characters in some places, but helps with readability. --- classes/RSSUtils.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'classes/RSSUtils.php') diff --git a/classes/RSSUtils.php b/classes/RSSUtils.php index 97b52c9aa..1c931e7e7 100644 --- a/classes/RSSUtils.php +++ b/classes/RSSUtils.php @@ -1432,7 +1432,7 @@ class RSSUtils { /** @var DOMElement $entry */ foreach ($entries as $entry) { foreach (array('src', 'poster') as $attr) { - if ($entry->hasAttribute($attr) && strpos($entry->getAttribute($attr), "data:") !== 0) { + if ($entry->hasAttribute($attr) && !str_starts_with($entry->getAttribute($attr), "data:")) { self::cache_media_url($cache, $entry->getAttribute($attr), $site_url); } } @@ -1753,7 +1753,7 @@ class RSSUtils { if ($dh) { while (($old_filename = readdir($dh)) !== false) { - if (strpos($old_filename, ".ico") !== false) { + if (str_ends_with($old_filename, ".ico")) { $new_filename = str_replace(".ico", "", $old_filename); $old_full_path = "$old_dir/$old_filename"; -- cgit v1.2.3-54-g00ecf