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 "