Make WordPress Core


Ignore:
Timestamp:
10/22/2015 04:37:31 PM (9 years ago)
Author:
wonderboymusic
Message:

oEmbed: if SimpleXMLElement does not exist, return an HTTP Error 501 Not implemented response.

Props swissspidy.
Fixes #34274.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-oembed-controller.php

    r34904 r35354  
    143143     */
    144144    public function xml_response( $data ) {
     145        if ( ! class_exists( 'SimpleXMLElement' ) ) {
     146            status_header( 501 );
     147            return get_status_header_desc( 501 );
     148        }
     149
    145150        $result = _oembed_create_xml( $data );
    146151
     
    148153        if ( ! $result ) {
    149154            status_header( 501 );
    150             return 'Not implemented';
     155            return get_status_header_desc( 501 );
    151156        }
    152157
Note: See TracChangeset for help on using the changeset viewer.