aboutsummaryrefslogtreecommitdiff
path: root/plugins/cache_starred_images/init.php
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2025-04-28 04:48:01 +0000
committerAndrew Dolgov <fox@fakecake.org>2025-04-28 04:48:01 +0000
commit4cb8a84df46d46bc325b6638defbdc4dc34151ed (patch)
tree77acdf9b8271568a53e636fc4e84d4bda1404f82 /plugins/cache_starred_images/init.php
parent0e4b8bd6538f3062d34a3a06ab5531c70042de78 (diff)
parentf80187e05f12c2fe9c487bff13058b207833b227 (diff)
Merge branch 'rip-mysql' into 'master'
initial attempt to remove mysql-related stuff from tt-rss See merge request tt-rss/tt-rss!120
Diffstat (limited to 'plugins/cache_starred_images/init.php')
-rwxr-xr-xplugins/cache_starred_images/init.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php
index 14a1fd7e9..527fb21ee 100755
--- a/plugins/cache_starred_images/init.php
+++ b/plugins/cache_starred_images/init.php
@@ -53,7 +53,7 @@ class Cache_Starred_Images extends Plugin {
site_url != '' AND
ttrss_user_entries.owner_uid = ? AND
plugin_data NOT LIKE '%starred_cache_images%'
- ORDER BY ".Db::sql_random_function()." LIMIT 100");
+ ORDER BY RANDOM() LIMIT 100");
if ($sth->execute([$this->host->get_owner_uid()])) {
@@ -122,6 +122,7 @@ class Cache_Starred_Images extends Plugin {
if ($article_id) {
$entries = $xpath->query('(//img[@src])|(//video/source[@src])');
+ /** @var DOMElement $entry */
foreach ($entries as $entry) {
if ($entry->hasAttribute('src')) {
$src = UrlHelper::rewrite_relative($site_url, $entry->getAttribute('src'));
@@ -197,6 +198,7 @@ class Cache_Starred_Images extends Plugin {
$xpath = new DOMXPath($doc);
$entries = $xpath->query('(//img[@src])|(//video/source[@src])');
+ /** @var DOMElement $entry */
foreach ($entries as $entry) {
if ($entry->hasAttribute('src') && !str_starts_with($entry->getAttribute('src'), "data:")) {