Browse code

viewseries.php: fix up the series existing check - this incidentally removes the PHP 7+ requirement...

Clarissa Walker authored on 2026/10/28 22:41:22
Showing 1 changed files
... ...
@@ -39,13 +39,14 @@ include(_BASEDIR."includes/pagesetup.php");
39 39
 $seriesid = (isset($_GET['seriesid']) && is_numeric($_GET['seriesid'])) ? escapestring($_GET['seriesid']) : false;
40 40
 $sresult = dbquery(_SERIESQUERY." AND seriesid = '$seriesid' LIMIT 1");
41 41
 $series = dbassoc($sresult);
42
+if (empty($seriesid)) $seriesid = isset($_GET['seriesid']) && isNumber($_GET['seriesid']) ? $_GET['seriesid'] : false;
42 43
 if(!$series) {
43 44
 	$current = "serieserror";
44 45
 	// load our template files to set up the page.
45 46
 	if (file_exists("$skindir/default.tpl")) $tpl = new TemplatePower("$skindir/default.tpl");
46 47
 	else $tpl = new TemplatePower("default_tpls/default.tpl");
47 48
 	$title = "Series was not found";
48
-	$text  = "Series with ID " . (($seriesid) ?? null) . " is not in database";
49
+	$text  = "Series with ID " . $seriesid . " is not in database";
49 50
 	include("includes/pagesetup.php");
50 51
 	$tpl->assign("output", "<div id='pagetitle'>" . $title . "</div>" . write_error($text));
51 52
 	$tpl->printToScreen();