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
This commit is contained in:
Sergey Biryukov 2014-03-12 12:53:49 +00:00
parent 8fc52817b9
commit 96b39f3363
1 changed files with 4 additions and 2 deletions

View File

@ -941,11 +941,13 @@ function trackback_url( $deprecated_echo = true ) {
* @param int $deprecated Not used (Was $timezone = 0). * @param int $deprecated Not used (Was $timezone = 0).
*/ */
function trackback_rdf( $deprecated = '' ) { function trackback_rdf( $deprecated = '' ) {
if ( !empty( $deprecated ) ) if ( ! empty( $deprecated ) ) {
_deprecated_argument( __FUNCTION__, '2.5' ); _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; return;
}
echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/"