In `WP_oEmbed`, only allow `__call()` to run against a whitelist of methods, `$compat_methods`.
See #30891. Built from https://develop.svn.wordpress.org/trunk@31148 git-svn-id: http://core.svn.wordpress.org/trunk@31129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a4092e90f0
commit
ed4e7b01d4
|
@ -21,6 +21,8 @@ class WP_oEmbed {
|
|||
public $providers = array();
|
||||
public static $early_providers = array();
|
||||
|
||||
private $compat_methods = array( '_fetch_with_format', '_parse_json', '_parse_xml', '_parse_body' );
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -170,7 +172,10 @@ class WP_oEmbed {
|
|||
* @return mixed|bool Return value of the callback, false otherwise.
|
||||
*/
|
||||
public function __call( $name, $arguments ) {
|
||||
return call_user_func_array( array( $this, $name ), $arguments );
|
||||
if ( in_array( $name, $this->compat_methods ) ) {
|
||||
return call_user_func_array( array( $this, $name ), $arguments );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-alpha-31147';
|
||||
$wp_version = '4.2-alpha-31148';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue