PHP 8 compat fix for showing freetag RSS feeds

This commit is contained in:
onli 2021-06-06 12:32:23 +02:00
parent 330cab353e
commit 62380a3086

View File

@ -12,13 +12,13 @@ if ($serendipity['cors']) {
header('Access-Control-Allow-Origin: *'); // Allow RSS feeds to be read by javascript header('Access-Control-Allow-Origin: *'); // Allow RSS feeds to be read by javascript
} }
$version = $_GET['version']; $version = $_GET['version'] ?? '';
$description = $serendipity['blogDescription']; $description = $serendipity['blogDescription'];
$title = $serendipity['blogTitle']; $title = $serendipity['blogTitle'];
$comments = FALSE; $comments = FALSE;
if (empty($version)) { if (empty($version)) {
list($version) = serendipity_discover_rss($_GET['file'], $_GET['ext']); list($version) = serendipity_discover_rss($_GET['file'] ?? null, $_GET['ext'] ?? null);
} else { } else {
# be sure it is an allowed version, to prevent attackers sniffing for unrelated files on the file system # be sure it is an allowed version, to prevent attackers sniffing for unrelated files on the file system
$allowed_versions = ['opml1.0', '0.91', '1.0', '2.0', 'atom0.3', 'atom1.0']; $allowed_versions = ['opml1.0', '0.91', '1.0', '2.0', 'atom0.3', 'atom1.0'];