From 96b39f33637d25ccf0a04f663944e9e4cbc17431 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 12 Mar 2014 12:53:49 +0000 Subject: [PATCH] Avoid a notice in trackback_rdf() if user agent is not set. props joostdevalk. fixes #27374. git-svn-id: https://develop.svn.wordpress.org/trunk@27514 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/comment-template.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php index 97e2c2ba3d..b87844b601 100644 --- a/src/wp-includes/comment-template.php +++ b/src/wp-includes/comment-template.php @@ -941,11 +941,13 @@ function trackback_url( $deprecated_echo = true ) { * @param int $deprecated Not used (Was $timezone = 0). */ function trackback_rdf( $deprecated = '' ) { - if ( !empty( $deprecated ) ) + if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, '2.5' ); + } - if ( false !== stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') ) + if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && false !== stripos( $_SERVER['HTTP_USER_AGENT'], 'W3C_Validator' ) ) { return; + } echo '