From 62be96c8da309f5fb3987d978b926f0e00266030 Mon Sep 17 00:00:00 2001 From: donncha Date: Mon, 15 Oct 2007 17:12:03 +0000 Subject: Disable xmlrpc posting by default git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1077 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/wpmu-functions.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'wp-includes') diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php index 7950ef5..e31d86e 100644 --- a/wp-includes/wpmu-functions.php +++ b/wp-includes/wpmu-functions.php @@ -1923,4 +1923,15 @@ function redirect_this_site( $hosts ) { return array( $current_site->domain ); } add_filter( 'allowed_redirect_hosts', 'redirect_this_site' ); + +function is_xmlrpc_active() { + global $HTTP_RAW_POST_DATA; + if ($HTTP_RAW_POST_DATA) + $data = $HTTP_RAW_POST_DATA; + + // kill everything but pingbacks if xmlrpc is disabled + if( defined( 'XMLRPC_REQUEST' ) && strpos( $data, 'pingback.ping' ) === false && get_site_option( 'xmlrpc_active' ) != 'yes' ) + die(); +} +add_action( 'init', 'is_xmlrpc_active' ); ?> -- cgit