Make WordPress Core

Changeset 31148


Ignore:
Timestamp:
01/11/2015 10:26:55 PM (12 years ago)
Author:
wonderboymusic
Message:

In WP_oEmbed, only allow __call() to run against a whitelist of methods, $compat_methods.

See #30891.

File:
1 edited

Legend:

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

    r31083 r31148  
    2121        public $providers = array();
    2222        public static $early_providers = array();
     23
     24        private $compat_methods = array( '_fetch_with_format', '_parse_json', '_parse_xml', '_parse_body' );
    2325
    2426        /**
     
    171173         */
    172174        public function __call( $name, $arguments ) {
    173                 return call_user_func_array( array( $this, $name ), $arguments );
     175                if ( in_array( $name, $this->compat_methods ) ) {
     176                        return call_user_func_array( array( $this, $name ), $arguments );
     177                }
     178                return false;
    174179        }
    175180
Note: See TracChangeset for help on using the changeset viewer.