From 13d55aaff82ddddae93cc5b1eb5910ef5cb3b40d Mon Sep 17 00:00:00 2001 From: wpsmort Date: Wed, 22 Jun 2016 18:24:05 -0400 Subject: [PATCH] Issue #355 Fix for PHP error --- admin/aioseop_module_class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/admin/aioseop_module_class.php b/admin/aioseop_module_class.php index f1c11c0ec..3a50c94ea 100644 --- a/admin/aioseop_module_class.php +++ b/admin/aioseop_module_class.php @@ -424,6 +424,9 @@ function is_good_bot() { ); $botlist = apply_filters( $this->prefix . 'botlist', $botlist ); if ( ! empty( $botlist ) ) { + if( ! isset( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } $ua = $_SERVER['HTTP_USER_AGENT']; $uas = $this->quote_list_for_regex( $botlist ); if ( preg_match( '/' . $uas . '/i', $ua ) ) { @@ -596,6 +599,9 @@ function is_bad_bot() { $botlist = $this->default_bad_bots(); $botlist = apply_filters( $this->prefix . 'badbotlist', $botlist ); if ( ! empty( $botlist ) ) { + if( ! isset( $_SERVER['HTTP_USER_AGENT'] ) ) { + return false; + } $ua = $_SERVER['HTTP_USER_AGENT']; $uas = $this->quote_list_for_regex( $botlist ); if ( preg_match( '/' . $uas . '/i', $ua ) ) {