Ticket #24381: 24381.patch
File 24381.patch, 1.6 KB (added by , 11 years ago) |
---|
-
wp-includes/class-oembed.php
65 65 /** 66 66 * The do-it-all function that takes a URL and attempts to return the HTML. 67 67 * 68 * @see WP_oEmbed::discover()69 68 * @see WP_oEmbed::fetch() 70 69 * @see WP_oEmbed::data2html() 71 70 * … … 74 73 * @return bool|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed. 75 74 */ 76 75 function get_html( $url, $args = '' ) { 76 $provider = $this->get_provider( $url, $args ); 77 78 if ( !$provider || false === $data = $this->fetch( $provider, $url, $args ) ) 79 return false; 80 81 return apply_filters( 'oembed_result', $this->data2html( $data, $url ), $url, $args ); 82 } 83 84 /** 85 * Takes a URL and return the corresponding oEmbed provider URL, if there is one. 86 * 87 * @see WP_oEmbed::discover() 88 * 89 * @param string $url The URL to the content. 90 * @param array $args Optional arguments. 91 * @return bool|string False on failure, otherwise the oEmbed provider URL. 92 * @since 3.6 93 */ 94 function get_provider( $url, $args = array() ) { 95 77 96 $provider = false; 78 97 79 98 if ( !isset($args['discover']) ) … … 97 116 if ( !$provider && $args['discover'] ) 98 117 $provider = $this->discover( $url ); 99 118 100 if ( !$provider || false === $data = $this->fetch( $provider, $url, $args ) ) 101 return false; 119 return $provider; 102 120 103 return apply_filters( 'oembed_result', $this->data2html( $data, $url ), $url, $args );104 121 } 105 122 106 123 /**