aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 2025-10-25 11:21:28 +0200
committerGravatar GitHub <noreply@github.com> 2025-10-25 11:21:28 +0200
commitf1c91c84ddee0a9f3ef6d0775f630822c184963f (patch)
tree5a5291a2b29ff7614fc35d6d6c891abb1e090a52
parent11863fa00e71b05fe29529ab7588a4b845b6805a (diff)
Bump phpstan/phpstan from 2.1.29 to 2.1.31 (#8156)
* Bump phpstan/phpstan from 2.1.29 to 2.1.31 Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan-phar-composer-source) from 2.1.29 to 2.1.31. - [Commits](https://github.com/phpstan/phpstan-phar-composer-source/commits) --- updated-dependencies: - dependency-name: phpstan/phpstan dependency-version: 2.1.31 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Fixes --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
-rw-r--r--app/Models/Feed.php14
-rw-r--r--cli/CliOptionsParser.php1
-rw-r--r--composer.lock25
-rw-r--r--lib/favicons.php4
-rw-r--r--lib/lib_rss.php1
5 files changed, 28 insertions, 17 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 4f8a9130d..fd9177d4e 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -943,6 +943,9 @@ class FreshRSS_Feed extends Minz_Model {
// If the result is a list, then aggregate as a JSON array
$result = [];
foreach ($jsonFragments as $node) {
+ if (!($node instanceof DOMNode)) {
+ continue;
+ }
$json = json_decode($node->textContent, true);
if (json_last_error() === JSON_ERROR_NONE && is_array($json)) {
$result[] = $json;
@@ -1067,6 +1070,9 @@ class FreshRSS_Feed extends Minz_Model {
}
foreach ($nodes as $node) {
+ if (!($node instanceof DOMNode)) {
+ continue;
+ }
$item = [];
$item['title'] = $xPathItemTitle == '' ? '' : $xpathEvaluateString($xPathItemTitle, $node);
@@ -1077,7 +1083,9 @@ class FreshRSS_Feed extends Minz_Model {
// List of nodes, save as HTML
$content = '';
foreach ($result as $child) {
- $content .= $doc->saveHTML($child) . "\n";
+ if ($child instanceof DOMNode) {
+ $content .= $doc->saveHTML($child) . "\n";
+ }
}
$item['content'] = $content;
} elseif (is_string($result) || is_int($result) || is_bool($result)) {
@@ -1103,7 +1111,9 @@ class FreshRSS_Feed extends Minz_Model {
} elseif ($itemCategories instanceof DOMNodeList && $itemCategories->length > 0) {
$item['tags'] = [];
foreach ($itemCategories as $itemCategory) {
- $item['tags'][] = $itemCategory->textContent;
+ if ($itemCategory instanceof DOMNode) {
+ $item['tags'][] = $itemCategory->textContent;
+ }
}
}
}
diff --git a/cli/CliOptionsParser.php b/cli/CliOptionsParser.php
index 9ef9e9f10..dd507d341 100644
--- a/cli/CliOptionsParser.php
+++ b/cli/CliOptionsParser.php
@@ -122,6 +122,7 @@ abstract class CliOptionsParser {
foreach ($this->options as $name => $data) {
if (in_array($alias, $data->getAliases(), true)) {
$this->inputs[$name]['aliasUsed'] = $alias;
+ // @phpstan-ignore assign.propertyType (PHPStan error?)
$this->inputs[$name]['values'] = $value === false
? [$data->getOptionalValueDefault()]
: (is_array($value)
diff --git a/composer.lock b/composer.lock
index 0ebdab060..719d79379 100644
--- a/composer.lock
+++ b/composer.lock
@@ -69,16 +69,16 @@
},
{
"name": "nikic/php-parser",
- "version": "v5.6.1",
+ "version": "v5.6.2",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2"
+ "reference": "3a454ca033b9e06b63282ce19562e892747449bb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2",
- "reference": "f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/3a454ca033b9e06b63282ce19562e892747449bb",
+ "reference": "3a454ca033b9e06b63282ce19562e892747449bb",
"shasum": ""
},
"require": {
@@ -121,9 +121,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
- "source": "https://github.com/nikic/PHP-Parser/tree/v5.6.1"
+ "source": "https://github.com/nikic/PHP-Parser/tree/v5.6.2"
},
- "time": "2025-08-13T20:13:15+00:00"
+ "time": "2025-10-21T19:32:17+00:00"
},
{
"name": "phar-io/manifest",
@@ -245,16 +245,11 @@
},
{
"name": "phpstan/phpstan",
- "version": "2.1.29",
- "source": {
- "type": "git",
- "url": "https://github.com/phpstan/phpstan-phar-composer-source.git",
- "reference": "git"
- },
+ "version": "2.1.31",
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d618573eed4a1b6b75e37b2e0b65ac65c885d88e",
- "reference": "d618573eed4a1b6b75e37b2e0b65ac65c885d88e",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/ead89849d879fe203ce9292c6ef5e7e76f867b96",
+ "reference": "ead89849d879fe203ce9292c6ef5e7e76f867b96",
"shasum": ""
},
"require": {
@@ -299,7 +294,7 @@
"type": "github"
}
],
- "time": "2025-09-25T06:58:18+00:00"
+ "time": "2025-10-10T14:14:11+00:00"
},
{
"name": "phpstan/phpstan-phpunit",
diff --git a/lib/favicons.php b/lib/favicons.php
index 3072874d7..786f832fc 100644
--- a/lib/favicons.php
+++ b/lib/favicons.php
@@ -26,6 +26,10 @@ function faviconCachePath(string $url): string {
}
function searchFavicon(string $url): string {
+ $url = trim($url);
+ if ($url === '') {
+ return '';
+ }
$dom = new DOMDocument();
['body' => $html, 'effective_url' => $effective_url, 'fail' => $fail] = httpGet($url, cachePath: CACHE_PATH . '/' . sha1($url) . '.html', type: 'html');
if ($fail || $html === '' || !@$dom->loadHTML($html, LIBXML_NONET | LIBXML_NOERROR | LIBXML_NOWARNING)) {
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 266e95b65..01c8a0088 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -570,6 +570,7 @@ function enforceHtmlBase(string $html, string $href): string {
}
/**
+ * @param non-empty-string $url
* @param string $type {html,ico,json,opml,xml}
* @param array<string,mixed> $attributes
* @param array<int,mixed> $curl_options