diff --git a/wp-includes/class-wp-oembed-controller.php b/wp-includes/class-wp-oembed-controller.php
index 2da7f3e5db..22c062be9f 100644
--- a/wp-includes/class-wp-oembed-controller.php
+++ b/wp-includes/class-wp-oembed-controller.php
@@ -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() ) {
diff --git a/wp-includes/embed-functions.php b/wp-includes/embed-functions.php
index fa796ac791..e5837cf453 100644
--- a/wp-includes/embed-functions.php
+++ b/wp-includes/embed-functions.php
@@ -351,7 +351,10 @@ function wp_oembed_add_discovery_links() {
if ( is_singular() ) {
$output .= '' . "\n";
- $output .= '' . "\n";
+
+ if ( class_exists( 'SimpleXMLElement' ) ) {
+ $output .= '' . "\n";
+ }
}
/**
diff --git a/wp-includes/version.php b/wp-includes/version.php
index d98b312604..207b32c408 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
-$wp_version = '4.4-alpha-35353';
+$wp_version = '4.4-alpha-35354';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.