From e99eb28b39bb59aafc59134a1abb3853ba5711b4 Mon Sep 17 00:00:00 2001 From: Justin McCombs Date: Tue, 30 Dec 2014 16:14:53 -0500 Subject: [PATCH] Update to fix command line error If called from a command line application, the HTTP_ACCEPT $_SERVER attribute is not found and causes an error. --- Holmes.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Holmes.php b/Holmes.php index 8e884c0..aa6870b 100644 --- a/Holmes.php +++ b/Holmes.php @@ -71,6 +71,11 @@ public static function isTablet() */ public static function isMobile() { + if ( empty($_SERVER['HTTP_ACCEPT']) ) + { + return false; + } + $accept = $_SERVER['HTTP_ACCEPT']; if (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE']))