diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-15 17:12:03 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-15 17:12:03 +0000 |
commit | 62be96c8da309f5fb3987d978b926f0e00266030 (patch) | |
tree | c03bd93e82823cfaa19733a87f18be2fae121d14 /wp-includes | |
parent | 157499c240c15fb5bdd3e5ac23f7153638b0b3dc (diff) | |
download | wordpress-mu-62be96c8da309f5fb3987d978b926f0e00266030.tar.gz wordpress-mu-62be96c8da309f5fb3987d978b926f0e00266030.tar.xz wordpress-mu-62be96c8da309f5fb3987d978b926f0e00266030.zip |
Disable xmlrpc posting by default
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1077 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes')
-rw-r--r-- | wp-includes/wpmu-functions.php | 11 |
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' ); ?> |