From d1e040b7ecefad42d752e48de2cdf89a6dc80ac6 Mon Sep 17 00:00:00 2001 From: onli Date: Tue, 16 Mar 2021 19:39:31 +0100 Subject: [PATCH] php 8 compat: fix undefined array access adnd $year,... construct --- include/functions_routing.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/functions_routing.inc.php b/include/functions_routing.inc.php index 9ba5ca12..07d8838b 100644 --- a/include/functions_routing.inc.php +++ b/include/functions_routing.inc.php @@ -52,6 +52,9 @@ function locateHiddenVariables($_args) { } } elseif ($v == 'summary') { /* Summary */ $serendipity['short_archives'] = true; + if (! array_key_exists('head_subtitle', $serendipity)) { + $serendipity['head_subtitle'] = ''; + } $serendipity['head_subtitle'] .= SUMMARY . ' - '; unset($_args[$k]); } elseif ($v[0] == 'C') { /* category */ @@ -395,7 +398,9 @@ function serveArchives() { $_args = locateHiddenVariables($serendipity['uriArguments']); /* We must always *assume* that Year, Month and Day are the first 3 arguments */ - list(,$year, $month, $day) = $_args; + $year = $_args[0] ?? null; + $month = $_args[1] ?? null; + $day = $_args[2] ?? null; if ($year == "archives") { unset($year); }