[wp-trac] [WordPress Trac] #36055: Filter xmlrpc_enabled only partly works

WordPress Trac noreply at wordpress.org
Fri Mar 4 16:03:29 UTC 2016


#36055: Filter xmlrpc_enabled only partly works
--------------------------+------------------
 Reporter:  markoheijnen  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.5
Component:  XML-RPC       |     Version:  2.9
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------

Comment (by markoheijnen):

 That's why I believe the second patch is a nice solution between
 completely disabling the XML-RPC and what is currently there.

 > The initial intention was different. The patch as it is now is not
 needed because its behavior would be the same as filtering all methods
 with the 'xmlrpc_methods' filter like:
 >
 > {{{#!php
 > <?php
 > add_filter( 'xmlrpc_methods', 'remove_xmlrpc_methods');
 > function remove_xmlrpc_methods( $methods ) {
 >     foreach ( $methods as $key => $value) {
 >         if ( strpos( $value, 'pingback' ) === false ) {
 >             unset( $methods[$key] );
 >         }
 >     }
 >     return $methods;
 > }
 > }}}
 >
 The code does behave differently because it will reply that the method
 doesn't exists. Also the system.* methods can still be performed.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36055#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list