Encode HTML chars in RSS feed

This commit is contained in:
Steffen Lange 2020-12-31 18:49:05 +01:00
parent 6a4401f888
commit afc80af354

View file

@ -23,11 +23,11 @@ $db->sort();
for ($i = 0; $i < $db->count(); $i++) { for ($i = 0; $i < $db->count(); $i++) {
$patch = $db->get($i); $patch = $db->get($i);
echo '<item>'; echo '<item>';
echo '<title>' . $patch->getVendor() . ' released ' . $patch->getProduct(); echo '<title>' . htmlspecialchars($patch->getVendor()) . ' released ' . htmlspecialchars($patch->getProduct());
if (!empty($patch->getBranch())) if (!empty($patch->getBranch()))
echo ' ' . $patch->getBranch(); echo ' ' . htmlspecialchars($patch->getBranch());
echo ' version ' . $patch->getVersion() . '.</title>'; echo ' version ' . htmlspecialchars($patch->getVersion()) . '.</title>';
echo '<link>' . $patch->getURL() . '</link>'; echo '<link>' . htmlspecialchars($patch->getURL()) . '</link>';
echo '<pubDate>' . date(DATE_RSS, $patch->getTimestamp()) . '</pubDate>'; echo '<pubDate>' . date(DATE_RSS, $patch->getTimestamp()) . '</pubDate>';
echo '<guid isPermaLink="false">' . hash('sha256', $patch) . '</guid>'; echo '<guid isPermaLink="false">' . hash('sha256', $patch) . '</guid>';
echo '</item>' . "\r\n"; echo '</item>' . "\r\n";