From 547ed7685a7b87b7b960380d9bcdcf21b8288247 Mon Sep 17 00:00:00 2001 From: Thomas Maier Date: Wed, 9 Dec 2015 10:49:37 +0100 Subject: [PATCH] fix error log when HTTP_USER_AGENT is missing HTTP_USER_AGENT is not always set, which causes an entry in the error log file, if WP_DEBUG is enabled. --- util/crayon_util.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/crayon_util.class.php b/util/crayon_util.class.php index ca4790fe..512ffda4 100644 --- a/util/crayon_util.class.php +++ b/util/crayon_util.class.php @@ -790,7 +790,7 @@ public static function preg_escape_back($string) { // Detect if on a Mac or PC public static function is_mac($default = FALSE) { - $user = $_SERVER['HTTP_USER_AGENT']; + $user = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; if (stripos($user, 'macintosh') !== FALSE) { return TRUE; } else if (stripos($user, 'windows') !== FALSE || stripos($user, 'linux') !== FALSE) {