Avoid a notice in trackback_rdf() if user agent is not set.

props joostdevalk.
fixes #27374.
Built from https://develop.svn.wordpress.org/trunk@27514


git-svn-id: http://core.svn.wordpress.org/trunk@27357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-03-12 12:54:15 +00:00
parent 2a7918390b
commit 8343fabff6
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).
*/
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 '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"