summaryrefslogtreecommitdiffstats
path: root/wp-includes
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes')
-rw-r--r--wp-includes/wpmu-functions.php11
1 files changed, 11 insertions, 0 deletions
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, '<methodName>pingback.ping</methodName>' ) === false && get_site_option( 'xmlrpc_active' ) != 'yes' )
+ die();
+}
+add_action( 'init', 'is_xmlrpc_active' );
?>