aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleteoryx <alyx@aleteoryx.me>2024-11-14 17:44:42 -0500
committerAleteoryx <alyx@aleteoryx.me>2024-11-14 17:46:39 -0500
commited7eeb11c74bd8fedf40d0618e34c4a6c1f5b10a (patch)
tree126492f51011121e6372a2303ad96f550275ed06
parentd76ea6375334b758fcdbe84252515b3059ff8e53 (diff)
downloadrss_dot_php-ed7eeb11c74bd8fedf40d0618e34c4a6c1f5b10a.tar.gz
rss_dot_php-ed7eeb11c74bd8fedf40d0618e34c4a6c1f5b10a.tar.bz2
rss_dot_php-ed7eeb11c74bd8fedf40d0618e34c4a6c1f5b10a.zip
encoding fix
-rw-r--r--rss.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/rss.php b/rss.php
index 022b6e6..4efb696 100644
--- a/rss.php
+++ b/rss.php
@@ -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>