aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Entry.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-05-11 13:02:04 +0200
committerGravatar GitHub <noreply@github.com> 2023-05-11 13:02:04 +0200
commit6e2f2f1c1e98ecd86aa89c6547beb742d7385d18 (patch)
tree7ba9f5aebb01d12045b9067a86b5060ba13dca18 /app/Models/Entry.php
parentfe7d9bbcd68660a59b813346c236b61b25a51c80 (diff)
A few additional PHPStan rules (#5388)
A subset of https://github.com/phpstan/phpstan-strict-rules
Diffstat (limited to 'app/Models/Entry.php')
-rw-r--r--app/Models/Entry.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index b0beaaa99..2b0216bbe 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -156,9 +156,9 @@ class FreshRSS_Entry extends Minz_Model {
$content = $this->content;
- $thumbnail = $this->attributes('thumbnail');
- if (!empty($thumbnail['url'])) {
- $elink = $thumbnail['url'];
+ $thumbnailAttribute = $this->attributes('thumbnail');
+ if (!empty($thumbnailAttribute['url'])) {
+ $elink = $thumbnailAttribute['url'];
if ($allowDuplicateEnclosures || !self::containsLink($content, $elink)) {
$content .= <<<HTML
<figure class="enclosure">
@@ -243,7 +243,7 @@ HTML;
if ($searchEnclosures || $searchBodyImages) {
$dom = new DOMDocument();
$dom->loadHTML('<?xml version="1.0" encoding="UTF-8" ?>' . $this->content, LIBXML_NONET | LIBXML_NOERROR | LIBXML_NOWARNING);
- $xpath = new DOMXpath($dom);
+ $xpath = new DOMXPath($dom);
}
if ($searchEnclosures) {
// Legacy code for database entries < FreshRSS 1.20.1
@@ -522,10 +522,10 @@ HTML;
// Searches are combined by OR and are not recursive
$ok = true;
if ($filter->getEntryIds()) {
- $ok &= in_array($this->id, $filter->getEntryIds());
+ $ok &= in_array($this->id, $filter->getEntryIds(), true);
}
if ($ok && $filter->getNotEntryIds()) {
- $ok &= !in_array($this->id, $filter->getNotEntryIds());
+ $ok &= !in_array($this->id, $filter->getNotEntryIds(), true);
}
if ($ok && $filter->getMinDate()) {
$ok &= strnatcmp($this->id, $filter->getMinDate() . '000000') >= 0;
@@ -552,10 +552,10 @@ HTML;
$ok &= $this->date > $filter->getNotMaxPubdate();
}
if ($ok && $filter->getFeedIds()) {
- $ok &= in_array($this->feedId, $filter->getFeedIds());
+ $ok &= in_array($this->feedId, $filter->getFeedIds(), true);
}
if ($ok && $filter->getNotFeedIds()) {
- $ok &= !in_array($this->feedId, $filter->getFeedIds());
+ $ok &= !in_array($this->feedId, $filter->getFeedIds(), true);
}
if ($ok && $filter->getAuthor()) {
foreach ($filter->getAuthor() as $author) {
@@ -719,7 +719,7 @@ HTML;
$filterednode->parentNode->removeChild($filterednode);
}
}
- $content .= $doc->saveHtml($node) . "\n";
+ $content .= $doc->saveHTML($node) . "\n";
}
}
$html = trim(sanitizeHTML($content, $base));