From e2c6b927c8e8b10d2a5835abf737195fa42242dd Mon Sep 17 00:00:00 2001 From: Florian Schlichting Date: Fri, 6 Dec 2019 18:17:18 +0800 Subject: [PATCH] HTTP_REFERER will usually be unset for caldav requests, prevent "Undefined index" warnings --- htdocs/always.php | 2 +- inc/always.php.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/always.php b/htdocs/always.php index 58f067eb..9ecf4247 100644 --- a/htdocs/always.php +++ b/htdocs/always.php @@ -45,7 +45,7 @@ function clean_get() { if(isset($_POST)) array_walk($_POST, 'filter_post'); $_GET = clean_get(); $_SERVER['REQUEST_URI'] = str_replace("&", "&", htmlspecialchars($_SERVER['REQUEST_URI'])); -$_SERVER['HTTP_REFERER'] = htmlspecialchars($_SERVER['HTTP_REFERER']); +$_SERVER['HTTP_REFERER'] = htmlspecialchars(@$_SERVER['HTTP_REFERER']); diff --git a/inc/always.php.in b/inc/always.php.in index b6bebcbf..10f07753 100644 --- a/inc/always.php.in +++ b/inc/always.php.in @@ -45,7 +45,7 @@ function clean_get() { if(isset($_POST)) array_walk($_POST, 'filter_post'); $_GET = clean_get(); $_SERVER['REQUEST_URI'] = str_replace("&", "&", htmlspecialchars($_SERVER['REQUEST_URI'])); -$_SERVER['HTTP_REFERER'] = htmlspecialchars($_SERVER['HTTP_REFERER']); +$_SERVER['HTTP_REFERER'] = htmlspecialchars(@$_SERVER['HTTP_REFERER']);