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:
Scott Taylor
2015-10-22 16:37:31 +00:00
parent ff49cc7ebf
commit a19a0e6e72
3 changed files with 13 additions and 5 deletions

View File

@@ -351,7 +351,10 @@ function wp_oembed_add_discovery_links() {
if ( is_singular() ) {
$output .= '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";
$output .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n";
if ( class_exists( 'SimpleXMLElement' ) ) {
$output .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n";
}
}
/**