diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-09-19 13:05:29 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-09-19 13:05:29 +0000 |
commit | fceaa31bd8c35850ef9ab42c612e6c39a500c71c (patch) | |
tree | dc80d714618991f9a96eefa6a9fab659cc82ce3e /wp-includes/update.php | |
parent | 97133b20063404913537feb138e31bcabec590e5 (diff) | |
download | wordpress-mu-fceaa31bd8c35850ef9ab42c612e6c39a500c71c.tar.gz wordpress-mu-fceaa31bd8c35850ef9ab42c612e6c39a500c71c.tar.xz wordpress-mu-fceaa31bd8c35850ef9ab42c612e6c39a500c71c.zip |
Add mu version blog count to update request.
Add current_site details to User Agent with "currentsite_on_version_check" filter.
Store current version details in a site option.
Only show update messages to site admins.
git-svn-id: http://svn.automattic.com/wordpress-mu/branches/2.6@1481 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/update.php')
-rw-r--r-- | wp-includes/update.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/wp-includes/update.php b/wp-includes/update.php index 2aa3a6c..437e938 100644 --- a/wp-includes/update.php +++ b/wp-includes/update.php @@ -22,27 +22,27 @@ function wp_version_check() { if ( !function_exists('fsockopen') || defined('WP_INSTALLING') ) return; - global $wp_version, $current_site; + global $wp_version, $wpmu_version, $current_site; $php_version = phpversion(); - $current = get_option( 'update_core' ); + $current = get_site_option( 'update_core' ); $locale = get_locale(); if ( isset( $current->last_checked ) && 43200 > ( time() - $current->last_checked ) && - $current->version_checked == $wp_version + $current->version_checked == $wpmu_version ) return false; $new_option = ''; $new_option->last_checked = time(); // this gets set whether we get a response or not, so if something is down or misconfigured it won't delay the page load for more than 3 seconds, twice a day - $new_option->version_checked = $wp_version; + $new_option->version_checked = $wpmu_version; - $http_request = "GET /core/version-check/1.1/?version=$wp_version&php=$php_version&locale=$locale HTTP/1.0\r\n"; + $http_request = "GET /core/version-check/1.1/?version=$wp_version&wpmuversion=$wpmu_version&php=$php_version&locale=$locale&blogs=" . get_blog_count() . " HTTP/1.0\r\n"; $http_request .= "Host: api.wordpress.org\r\n"; $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset=' . get_option('blog_charset') . "\r\n"; - $http_request .= 'User-Agent: WordPress MU/' . $wpmu_version . '; ' . get_bloginfo('url') . '; http://' . $current_site->domain . $current_site->path . "\r\n"; + $http_request .= 'User-Agent: WordPress MU/' . $wpmu_version . '; ' . apply_filters( 'currentsite_on_version_check', 'http://' . $current_site->domain . $current_site->path ) . "\r\n"; $http_request .= "\r\n"; $response = ''; @@ -63,11 +63,11 @@ function wp_version_check() { $new_option->response = attribute_escape( $returns[0] ); if ( isset( $returns[1] ) ) - $new_option->url = clean_url( $returns[1] ); + $new_option->url = 'http://mu.wordpress.org/'; if ( isset( $returns[2] ) ) $new_option->current = attribute_escape( $returns[2] ); } - update_option( 'update_core', $new_option ); + update_site_option( 'update_core', $new_option ); } add_action( 'init', 'wp_version_check' ); |