Skip to content

Normalize encoding uppercase#936

Merged
jtojnar merged 2 commits intosimplepie:masterfrom
FreshRSS:normalize-uppercase-encoding
Sep 14, 2025
Merged

Normalize encoding uppercase#936
jtojnar merged 2 commits intosimplepie:masterfrom
FreshRSS:normalize-uppercase-encoding

Conversation

@Alkarex
Copy link
Contributor

@Alkarex Alkarex commented Aug 14, 2025

SimplePie uses uppercase for encoding everywhere, except in the parser, which makes array_unique() to fail to do its job when the document declares utf-8 and we already have UTF-8 in the list:

simplepie/src/SimplePie.php

Lines 1780 to 1785 in 1838b28

$encodings = array_merge($encodings, $this->registry->call(Misc::class, 'xml_encoding', [$this->raw_data, &$this->registry]));
$encodings[] = 'UTF-8';
$encodings[] = 'ISO-8859-1';
// There's no point in trying an encoding twice
$encodings = array_unique($encodings);

SimplePie uses uppercase for encoding everywhere, except in the parser, which makes `array_unique()` to fail to do its job when the document declares `utf-8` and we already have `UTF-8` in the list:
https://github.com/simplepie/simplepie/blob/1838b28db27ee206e0c2cf183f7b2af75abed143/src/SimplePie.php#L1780-L1785
@jtojnar jtojnar merged commit 31d31dc into simplepie:master Sep 14, 2025
10 checks passed
@jtojnar jtojnar added this to the 1.10.0 milestone Sep 14, 2025
@jtojnar
Copy link
Member

jtojnar commented Sep 14, 2025

Thanks.

@Alkarex Alkarex deleted the normalize-uppercase-encoding branch September 14, 2025 21:53
Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request Sep 15, 2025
Alkarex added a commit to FreshRSS/FreshRSS that referenced this pull request Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants