From 3fe6bd8afb8805b7d000b322af5e16409c7024e1 Mon Sep 17 00:00:00 2001 From: Nabil Kadimi Date: Sat, 28 Dec 2019 00:37:30 +0100 Subject: [PATCH] Prevent E_NOTICE --- templates/event-calendar.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/event-calendar.php b/templates/event-calendar.php index 04c91af1..acaf53eb 100644 --- a/templates/event-calendar.php +++ b/templates/event-calendar.php @@ -183,10 +183,11 @@ if ( $dayswithposts ) { $daywithpost = array(); } -if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'camino') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'safari') !== false) +if ( array_key_exists( 'HTTP_USER_AGENT', $_SERVER ) && preg_match( 'MSIE|camino|safari', $_SERVER[ 'HTTP_USER_AGENT' ] ) ) { $ak_title_separator = "\n"; -else +} else { $ak_title_separator = ', '; +} $ak_titles_for_day = array(); $ak_post_titles = $wpdb->get_results("SELECT ID, post_title, post_date, DAYOFMONTH(post_date) as dom "