Fix bad encoding for tidy_repair_string

Tidy on PHP 8.5 is more restrictive on what can be given as input encoding. Before, it worked as an unknown value was converted to `utf8`.
This commit is contained in:
Jeremy Benoist
2026-03-27 20:34:45 +01:00
parent e4e975db96
commit 952588ee1f
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -118,7 +118,7 @@ class Readability implements LoggerAwareInterface
'enclose-text' => true,
'merge-divs' => true,
// 'merge-spans' => true,
'input-encoding' => '????',
'input-encoding' => 'utf8',
'output-encoding' => 'utf8',
'hide-comments' => true,
];
+1
View File
@@ -17,6 +17,7 @@ class ReadabilityTest extends \PHPUnit\Framework\TestCase
public function testConstructDefault()
{
$readability = $this->getReadability('');
$this->assertSame('utf8', $readability->tidy_config['input-encoding']);
$this->assertNull($readability->url);
$this->assertInstanceOf(\DOMDocument::class, $readability->dom);