diff options
author | Aleteoryx <alyx@aleteoryx.me> | 2024-11-14 17:44:42 -0500 |
---|---|---|
committer | Aleteoryx <alyx@aleteoryx.me> | 2024-11-14 17:46:39 -0500 |
commit | ed7eeb11c74bd8fedf40d0618e34c4a6c1f5b10a (patch) | |
tree | 126492f51011121e6372a2303ad96f550275ed06 /rss.php | |
parent | d76ea6375334b758fcdbe84252515b3059ff8e53 (diff) | |
download | rss_dot_php-ed7eeb11c74bd8fedf40d0618e34c4a6c1f5b10a.tar.gz rss_dot_php-ed7eeb11c74bd8fedf40d0618e34c4a6c1f5b10a.tar.bz2 rss_dot_php-ed7eeb11c74bd8fedf40d0618e34c4a6c1f5b10a.zip |
encoding fix
Diffstat (limited to 'rss.php')
-rw-r--r-- | rss.php | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -165,7 +165,9 @@ function strip_html(string $html): string { if ($html === "") return $html; $doc = new DomDocument(); - @$doc->loadHTML($html); + + // this is a really ugly hack but libxml has left me no choice :( + @$doc->loadHTML("<meta charset='UTF-8'>".$html); foreach($doc->getElementsByTagName("style")->getIterator() as $el) $el->remove(); @@ -246,7 +248,7 @@ $base = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); <!doctype html> <html lang="<?= $config['lang'] ?>"> <head> - <meta charset="utf-8"> + <meta charset="UTF-8"> <style><?= $config['custom_css'] ?></style> </head> <body> |