diff options
author | Slávek Banko <[email protected]> | 2021-03-11 17:11:42 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2021-03-11 17:11:42 +0100 |
commit | 923512ebaa328076bfb577441fb9ee9f7dbba767 (patch) | |
tree | 3e9f9b57f56baa057320c2651e5ebf5212cd1b0a | |
parent | 65daee6fc5ecb10a261903df5c0af5867b5c7725 (diff) | |
download | website-core-923512ebaa328076bfb577441fb9ee9f7dbba767.tar.gz website-core-923512ebaa328076bfb577441fb9ee9f7dbba767.zip |
Update RSS generating script:
+ use utf-8 encoding instead of iso-8859-1
+ use https links instead of http
Signed-off-by: Slávek Banko <[email protected]>
-rwxr-xr-x | rss.php | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -30,7 +30,7 @@ function processDir($dirname, $phpfile) { $linestring = strip_tags($convert[$i]); $linestring = str_replace("<", "<", $linestring); $linestring = str_replace(">", ">", $linestring); - echo $linestring. "<br>\n"; //write value by index + echo $linestring. "<br/>\n"; //write value by index } else { $title = $title . strip_tags($convert[$i]) . "</title>\n"; @@ -43,8 +43,8 @@ function processDir($dirname, $phpfile) { } echo " ]]></description>\n"; // if (count($convert) > $newscollapsedlines) { - echo " <link>http://www.trinitydesktop.org/newsentry.php?entry=" . $file . "</link>\n"; - echo " <guid isPermaLink=\"true\">http://www.trinitydesktop.org/newsentry.php?entry=" . $file . "</guid>\n"; + echo " <link>https://www.trinitydesktop.org/newsentry.php?entry=" . $file . "</link>\n"; + echo " <guid isPermaLink=\"true\">https://www.trinitydesktop.org/newsentry.php?entry=" . $file . "</guid>\n"; // } echo " </item>\n"; } @@ -54,15 +54,14 @@ function processDir($dirname, $phpfile) { } } -header('Content-type: application/rss+xml'); +header('Content-type: application/rss+xml; charset=utf-8'); -/*echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";*/ -echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n"; +echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"; echo "<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n"; echo " <channel>\n"; -echo " <atom:link href=\"http://www.trinitydesktop.org/rss.php\" rel=\"self\" type=\"application/rss+xml\" />\n"; +echo " <atom:link href=\"https://www.trinitydesktop.org/rss.php\" rel=\"self\" type=\"application/rss+xml\" />\n"; echo " <title>Trinity Desktop Environment News</title>\n"; -echo " <link>http://www.trinitydesktop.org/</link>\n"; +echo " <link>https://www.trinitydesktop.org/</link>\n"; echo " <description>News of the Trinity Desktop Environment, a full-featured professional desktop for Linux.</description>\n"; echo " <language>en</language>\n"; @@ -73,5 +72,3 @@ echo " </channel>\n"; echo "</rss>\n"; ?> - - |