Skip to content

Merge upstream#77

Merged
Alkarex merged 4 commits into
freshrssfrom
merge-upstream
May 26, 2026
Merged

Merge upstream#77
Alkarex merged 4 commits into
freshrssfrom
merge-upstream

Conversation

@Alkarex
Copy link
Copy Markdown
Member

@Alkarex Alkarex commented May 26, 2026

No description provided.

Alkarex and others added 4 commits May 25, 2026 23:32
```
PHP Fatal error: Uncaught TypeError:
SimplePie\Enclosure::__construct(): Argument #20 ($player) must be of type ?string, array given
in /opt/freshrss/lib/simplepie/simplepie/src/Enclosure.php:199
```

This happens when there is no`url` parameter.

Example of feed:
* https://feeds.feedburner.com/crunchyroll/rss/anime?lang=deDE

Downstream issue:
* FreshRSS/FreshRSS#8892
Only atom:icon and a square rss2:image can be used to represent a favicon.
The existing get_image_url() is more for logos / banners, not favicon.
Example of real-world feeds:
* https://feedpress.me/frandroid
* https://www.lesnumeriques.com/rss.xml

Downstream:
* FreshRSS/FreshRSS#5518
* FreshRSS/FreshRSS#8633
…huge feed (simplepie#977)

PHP 8.4.0 introduced a new option[1], which makes it behave differently.

>  XML_OPTION_PARSE_HUGE (int)
>     Available as of PHP 8.4.0. When libxml2 < 2.7.0 is used (e.g. on PHP 7.x), this option is enabled by default and cannot be disabled.

The default value of this new option is `0`[2]. And this option is only effective when `libxml2` is used. `libexpat` totally ignores it[3].

This patch sets this option to `1`, the old default value, when this option is defined. So everything is consistent.

Yes, this brings more risks of potential DoS attack, but it should be defended somewhere else. Because the whole XML string is already downloaded into the memory when parsing, bars could be placed during downloading, no matter which PHP version and XML lib is used.

Downstream issue:
FreshRSS/FreshRSS#8516
FreshRSS/FreshRSS#8710

1. https://www.php.net/manual/en/xml.constants.php#constant.xml-option-parse-huge
2. https://github.com/php/php-src/blob/90744ec52a50e0eacab47d5a51d82c1b26607b76/ext/xml/xml.c#L1116
3. https://wiki.php.net/rfc/xml_option_parse_huge

Signed-off-by: Kidd Lee <LeeXiaolan@gmail.com>
@Alkarex Alkarex merged commit bccd36e into freshrss May 26, 2026
20 checks passed
@Alkarex Alkarex deleted the merge-upstream branch May 26, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants