From 1d08090560ac021abd6750b985c05ef652597941 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Mon, 1 Feb 2016 16:45:13 -0800 Subject: [PATCH] Use more reliable and cross server $_SERVER to retrieve the accepted content type --- system/src/Grav/Common/Errors/Errors.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/system/src/Grav/Common/Errors/Errors.php b/system/src/Grav/Common/Errors/Errors.php index f07faa159..688068451 100644 --- a/system/src/Grav/Common/Errors/Errors.php +++ b/system/src/Grav/Common/Errors/Errors.php @@ -14,9 +14,7 @@ class Errors { $grav = Grav::instance(); $config = $grav['config']->get('system.errors'); - - $headers = @apache_request_headers(); - $jsonRequest = $headers['Accept'] == 'application/json'; + $jsonRequest = $_SERVER && $_SERVER['HTTP_ACCEPT'] && $_SERVER['HTTP_ACCEPT'] == 'application/json'; // Setup Whoops-based error handler $whoops = new \Whoops\Run;