Fix oEmbed when the provider only supports XML responses.
[20539] removed string casts that would have taken place on SimpleXMLElement objects, which implement toString. Instead, convert the SimpleXMLElement object to a stdClass object before we leave _parse_xml(), for consistency with the simple object returned from _parse_json(). see #20246. for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@21701 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9a4bba9390
commit
909cbd75b8
@ -213,8 +213,14 @@ class WP_oEmbed {
|
||||
$errors = libxml_use_internal_errors( 'true' );
|
||||
$data = simplexml_load_string( $response_body );
|
||||
libxml_use_internal_errors( $errors );
|
||||
if ( is_object( $data ) )
|
||||
return $data;
|
||||
if ( ! is_object( $data ) )
|
||||
return false;
|
||||
|
||||
$return = new stdClass;
|
||||
foreach ( $data as $key => $value )
|
||||
$return->$key = (string) $value;
|
||||
|
||||
return $return;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user