From 4a8616214f799b01a3bc59a61582850c16dcc1f5 Mon Sep 17 00:00:00 2001 From: Hanno Date: Sun, 13 Oct 2019 18:21:18 +0200 Subject: [PATCH] Avoid undefined index notices. See #642. Backported from master branch. Signed-off-by: Thomas Hochstein --- include/compat.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/compat.inc.php b/include/compat.inc.php index e367d629..ae6b9292 100644 --- a/include/compat.inc.php +++ b/include/compat.inc.php @@ -373,19 +373,19 @@ if (ini_get('magic_quotes_gpc')) { } // Merge get and post into the serendipity array -if (is_array($_GET['serendipity'])) { +if (array_key_exists('serendipity', $_GET) && is_array($_GET['serendipity'])) { $serendipity['GET'] = &$_GET['serendipity']; } else { $serendipity['GET'] = array(); } -if (is_array($_POST['serendipity'])) { +if (array_key_exists('serendipity', $_POST) && is_array($_POST['serendipity'])) { $serendipity['POST'] = &$_POST['serendipity']; } else { $serendipity['POST'] = array(); } -if (is_array($_COOKIE['serendipity'])) { +if (array_key_exists('serendipity', $_COOKIE) && is_array($_COOKIE['serendipity'])) { $serendipity['COOKIE'] = &$_COOKIE['serendipity']; } else { $serendipity['COOKIE'] = array();