mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 03:04:34 +00:00
oEmbed: if SimpleXMLElement does not exist, return an HTTP Error 501 Not implemented response.
Props swissspidy. Fixes #34274. git-svn-id: https://develop.svn.wordpress.org/trunk@35354 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -142,12 +142,17 @@ final class WP_oEmbed_Controller {
|
||||
* @return string The XML response data.
|
||||
*/
|
||||
public function xml_response( $data ) {
|
||||
if ( ! class_exists( 'SimpleXMLElement' ) ) {
|
||||
status_header( 501 );
|
||||
return get_status_header_desc( 501 );
|
||||
}
|
||||
|
||||
$result = _oembed_create_xml( $data );
|
||||
|
||||
// Bail if there's no XML.
|
||||
if ( ! $result ) {
|
||||
status_header( 501 );
|
||||
return 'Not implemented';
|
||||
return get_status_header_desc( 501 );
|
||||
}
|
||||
|
||||
if ( ! headers_sent() ) {
|
||||
|
||||
Reference in New Issue
Block a user