diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php index de76afaac..071285e57 100644 --- a/wp-admin/includes/ms.php +++ b/wp-admin/includes/ms.php @@ -47,8 +47,8 @@ function wpmu_delete_blog($blog_id, $drop = false) { update_blog_status( $blog_id, 'deleted', 1 ); if ( $drop ) { - $drop_tables = $wpdb->get_results("show tables LIKE '". $wpdb->base_prefix . $blog_id . "\_%'", ARRAY_A); - $drop_tables = apply_filters( 'wpmu_drop_tables', $drop_tables ); + $drop_tables = $wpdb->get_results("show tables LIKE '". $wpdb->base_prefix . $blog_id . "\_%'", ARRAY_A); + $drop_tables = apply_filters( 'wpmu_drop_tables', $drop_tables ); reset( $drop_tables ); foreach ( (array) $drop_tables as $drop_table) { @@ -219,10 +219,10 @@ function update_option_new_admin_email($old_value, $value) { "newemail" => $value ); update_option( 'adminhash', $new_admin_email ); - + $content = apply_filters( 'new_admin_email_content', __("Dear user, -You recently requested to have the administration email address on +You recently requested to have the administration email address on your blog changed. If this is correct, please click on the following link to change it: ###ADMIN_URL### @@ -235,12 +235,12 @@ This email has been sent to ###EMAIL### Regards, All at ###SITENAME### ###SITEURL###"), $new_admin_email ); - + $content = str_replace('###ADMIN_URL###', clean_url(get_option( "siteurl" ).'/wp-admin/options.php?adminhash='.$hash), $content); $content = str_replace('###EMAIL###', $value, $content); $content = str_replace('###SITENAME###', get_site_option( 'site_name' ), $content); $content = str_replace('###SITEURL###', 'http://' . $current_site->domain . $current_site->path, $content); - + wp_mail( $value, sprintf(__('[%s] New Admin Email Address'), get_option('blogname')), $content ); } add_action('update_option_new_admin_email', 'update_option_new_admin_email', 10, 2); @@ -354,7 +354,7 @@ function get_site_allowed_themes() { function get_space_allowed() { $spaceAllowed = get_option("blog_upload_space"); - if( $spaceAllowed == false ) + if( $spaceAllowed == false ) $spaceAllowed = get_site_option("blog_upload_space"); if( empty($spaceAllowed) || !is_numeric($spaceAllowed) ) $spaceAllowed = 50; @@ -376,12 +376,12 @@ function display_space_usage() { $space .= __('MB'); } ?> - + @@ -432,9 +432,9 @@ function update_user_status( $id, $pref, $value, $refresh = 1 ) { if( $refresh == 1 ) refresh_user_details($id); - + if( $pref == 'spam' ) { - if( $value == 1 ) + if( $value == 1 ) do_action( "make_spam_user", $id ); else do_action( "make_ham_user", $id ); @@ -445,7 +445,7 @@ function update_user_status( $id, $pref, $value, $refresh = 1 ) { function refresh_user_details($id) { $id = (int) $id; - + if ( !$user = get_userdata( $id ) ) return false; @@ -464,8 +464,8 @@ function wpmu_checkAvailableSpace() { $spaceAllowed = get_space_allowed(); $dirName = trailingslashit( BLOGUPLOADDIR ); - if (!(is_dir($dirName) && is_readable($dirName))) - return; + if (!(is_dir($dirName) && is_readable($dirName))) + return; $dir = dir($dirName); $size = 0; @@ -512,7 +512,7 @@ function redirect_user_to_blog() { $c = 0; if ( isset( $_GET[ 'c' ] ) ) $c = (int)$_GET[ 'c' ]; - + if ( $c >= 5 ) { wp_die( __( "You don’t have permission to view this blog. Please contact the system administrator." ) ); } @@ -521,13 +521,13 @@ function redirect_user_to_blog() { $blog = get_active_blog_for_user( $current_user->ID ); $dashboard_blog = get_dashboard_blog(); if( is_object( $blog ) ) { - $protocol = ( is_ssl() ? 'https://' : 'http://' ); + $protocol = ( is_ssl() ? 'https://' : 'http://' ); wp_redirect( $protocol . $blog->domain . $blog->path . 'wp-admin/?c=' . $c ); // redirect and count to 5, "just in case" exit; } - /* - If the user is a member of only 1 blog and the user's primary_blog isn't set to that blog, + /* + If the user is a member of only 1 blog and the user's primary_blog isn't set to that blog, then update the primary_blog record to match the user's blog */ $blogs = get_blogs_of_user( $current_user->ID ); @@ -540,7 +540,7 @@ function redirect_user_to_blog() { } } $blog = get_blog_details( get_usermeta( $current_user->ID , 'primary_blog' ) ); - $protocol = ( is_ssl() ? 'https://' : 'http://' ); + $protocol = ( is_ssl() ? 'https://' : 'http://' ); wp_redirect( $protocol . $blog->domain . $blog->path . 'wp-admin/?c=' . $c ); // redirect and count to 5, "just in case" exit; } @@ -558,7 +558,7 @@ function mu_options( $options ) { } else { $writing = array( 'ping_sites', 'mailserver_login', 'mailserver_pass', 'default_email_category', 'mailserver_port', 'mailserver_url' ); } - $removed = array( + $removed = array( 'general' => array( 'siteurl', 'home', 'admin_email', 'users_can_register', 'default_role' ), 'reading' => array( 'gzipcompression' ), 'writing' => $writing, @@ -584,12 +584,12 @@ add_filter( 'import_allow_create_users', 'check_import_new_users' ); // See "import_allow_fetch_attachments" and "import_attachment_size_limit" filters too. function mu_dropdown_languages( $lang_files = array(), $current = '' ) { - $flag = false; + $flag = false; $output = array(); - + foreach ( (array) $lang_files as $val ) { $code_lang = basename( $val, '.mo' ); - + if ( $code_lang == 'en_US' ) { // American English $flag = true; $ae = __('American English'); @@ -602,18 +602,18 @@ function mu_dropdown_languages( $lang_files = array(), $current = '' ) { $translated = format_code_lang($code_lang); $output[$translated] = ''; } - - } - + + } + if ( $flag === false ) { // WordPress english $output[] = '"; } - + // Order by name uksort($output, 'strnatcasecmp'); - - $output = apply_filters('mu_dropdown_languages', $output, $lang_files, $current); - echo implode("\n\t", $output); + + $output = apply_filters('mu_dropdown_languages', $output, $lang_files, $current); + echo implode("\n\t", $output); } // Only show "Media" upload icon @@ -762,10 +762,10 @@ add_filter( 'wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2 function activate_sitewide_plugin() { if ( !isset( $_GET['sitewide'] ) ) return false; - + /* Add the plugin to the list of sitewide active plugins */ $active_sitewide_plugins = maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) ); - + /* Add the activated plugin to the list */ $active_sitewide_plugins[ $_GET['plugin'] ] = time(); @@ -775,7 +775,7 @@ function activate_sitewide_plugin() { return true; } -add_action( 'activate_' . $_GET['plugin'], 'activate_sitewide_plugin' ); +add_action( 'activate_' . $_GET['plugin'], 'activate_sitewide_plugin' ); /** * deactivate_sitewide_plugin() @@ -785,7 +785,7 @@ add_action( 'activate_' . $_GET['plugin'], 'activate_sitewide_plugin' ); function deactivate_sitewide_plugin( $plugin = false ) { if ( !$plugin ) $plugin = $_GET['plugin']; - + /* Get the active sitewide plugins */ $active_sitewide_plugins = (array) maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) ); @@ -797,11 +797,11 @@ function deactivate_sitewide_plugin( $plugin = false ) { if ( !update_site_option( 'active_sitewide_plugins', $active_sitewide_plugins ) ) wp_redirect( 'plugins.php?error=true' ); - + return true; } -add_action( 'deactivate_' . $_GET['plugin'], 'deactivate_sitewide_plugin' ); -add_action( 'deactivate_invalid_plugin', 'deactivate_sitewide_plugin' ); +add_action( 'deactivate_' . $_GET['plugin'], 'deactivate_sitewide_plugin' ); +add_action( 'deactivate_invalid_plugin', 'deactivate_sitewide_plugin' ); /** * add_sitewide_activate_row() @@ -811,13 +811,13 @@ add_action( 'deactivate_invalid_plugin', 'deactivate_sitewide_plugin' ); function add_sitewide_activate_row( $file, $plugin_data, $context ) { if ( !is_site_admin() ) return false; - + if ( 'sitewide-active' == $context ) return false; - + if ( is_plugin_active( $file ) ) return false; - + echo ''; echo '↑ ' . sprintf( __( 'Activate %s Site Wide' ), strip_tags( $plugin_data["Title"] ) ) . ''; @@ -834,13 +834,13 @@ add_action( 'after_plugin_row', 'add_sitewide_activate_row', 9, 3 ); function is_wpmu_sitewide_plugin( $file ) { /* Open the plugin file for reading to check if this is a ms-plugin. */ $fp = @fopen( WP_PLUGIN_DIR . '/' . $file, 'r' ); - + /* Pull only the first 8kiB of the file in. */ $plugin_data = @fread( $fp, 8192 ); - + /* PHP will close file handle, but we are good citizens. */ @fclose($fp); - + if ( preg_match( '|Site Wide Only:(.*)true$|mi', $plugin_data ) ) return true; @@ -858,14 +858,14 @@ function list_activate_sitewide_plugins() { if ( !is_site_admin() ) return false; - + $active_sitewide_plugins = maybe_unserialize( get_site_option( 'active_sitewide_plugins') ); $context = 'sitewide-active'; - if ( $active_sitewide_plugins ) { + if ( $active_sitewide_plugins ) { ?>

- +

@@ -898,7 +898,7 @@ function list_activate_sitewide_plugins() { $action_links = apply_filters( "plugin_action_links_$plugin_file", $action_links, $plugin_file, $plugin_data, $context ); $plugin_data = $all_plugins[$plugin_file]; - + echo " @@ -931,16 +931,16 @@ function list_activate_sitewide_plugins() { echo implode(' | ', $plugin_meta); echo "\n"; - + do_action( 'after_plugin_row', $plugin_file, $plugin_data, $context ); do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $context ); } ?>
 
- +

- + $activated_time ) { if ( is_wpmu_sitewide_plugin( $plugin_name ) ) unset( $inactive_plugins[ $plugin_name ] ); } } - + return $inactive_plugins; } add_filter( 'all_plugins', 'sitewide_filter_inactive_plugins_list' ); @@ -983,7 +983,7 @@ function sitewide_filter_active_plugins_list( $active_plugins ) { foreach ( $active_sitewide_plugins as $sitewide_plugin => $activated_time ) { unset( $active_plugins[ $sitewide_plugin ] ); } - + return $active_plugins; } add_filter( 'all_plugins', 'sitewide_filter_active_plugins_list' ); @@ -996,12 +996,12 @@ add_filter( 'all_plugins', 'sitewide_filter_active_plugins_list' ); */ function check_is_wpmu_plugin_on_activate() { /*** - * On plugin activation on a blog level, check to see if this is actually a + * On plugin activation on a blog level, check to see if this is actually a * site wide MU plugin. If so, deactivate and activate it site wide. */ if ( is_wpmu_sitewide_plugin( $_GET['plugin'] ) || isset( $_GET['sitewide'] ) ) { deactivate_plugins( $_GET['plugin'], true ); - + /* Silently activate because the activate_* hook has already run. */ if ( is_site_admin() ) { $_GET['sitewide'] = true; @@ -1022,7 +1022,7 @@ function check_wpmu_plugins_on_bulk_activate( $plugins ) { if ( is_site_admin() ) activate_sitewide_plugin( $plugin ); - } + } } } } @@ -1050,10 +1050,10 @@ function choose_primary_blog() { $found = false; ?> -
"; @@ -1216,8 +1216,8 @@ function stripslashes_from_options( $blog_id ) { while( $rows = $wpdb->get_results( "SELECT meta_key, meta_value FROM {$wpdb->sitemeta} ORDER BY meta_id LIMIT $start, 20" ) ) { foreach( $rows as $row ) { $value = $row->meta_value; - if ( !@unserialize( $value ) ) - $value = stripslashes( $value ); + if ( !@unserialize( $value ) ) + $value = stripslashes( $value ); if ( $value !== $row->meta_value ) { update_site_option( $row->meta_key, $value ); } @@ -1230,8 +1230,8 @@ function stripslashes_from_options( $blog_id ) { while( $rows = $wpdb->get_results( "SELECT option_name, option_value FROM $options_table ORDER BY option_id LIMIT $start, 20" ) ) { foreach( $rows as $row ) { $value = $row->option_value; - if ( !@unserialize( $value ) ) - $value = stripslashes( $value ); + if ( !@unserialize( $value ) ) + $value = stripslashes( $value ); if ( $value !== $row->option_value ) { update_blog_option( $blog_id, $row->option_name, $value ); } diff --git a/wp-admin/ms-admin.php b/wp-admin/ms-admin.php index 14e0b06df..8c9eee14f 100644 --- a/wp-admin/ms-admin.php +++ b/wp-admin/ms-admin.php @@ -30,7 +30,7 @@ $title = __( 'Site Admin' ); ?>
-

+

"; } diff --git a/wp-admin/ms-sites.php b/wp-admin/ms-sites.php index fd1b90905..57a6d974b 100644 --- a/wp-admin/ms-sites.php +++ b/wp-admin/ms-sites.php @@ -81,68 +81,68 @@ switch( $_GET['action'] ) {

- '>http://

- +

" . __( 'Global Settings' ) . "

"; @@ -1165,7 +1165,7 @@ function blogs_listing() { $rows[] = array_slice( $blogs, $split, $cols ); $split = $split + $cols; } - + foreach( $rows as $row ) { $c = $c == "alternate" ? "" : "alternate"; echo "
" . wp_specialchars($val) . "
- + - + - + - + - - - + + + - - - + + + - + - + + - + - + + - + - + + - + - + + - + - + +
http://

/>
/> /> -
/> /> -
/> /> -
/> /> -
/> /> -

- +

@@ -165,16 +165,16 @@ switch( $_GET['action'] ) { if ( stristr($val['option_value'], "\r") || stristr($val['option_value'], "\n") || stristr($val['option_value'], "\r\n") ) { ?> - + - - /> - + + /> +

- +
- '.$key.' - ' . __( 'Active' ) . ' + '.$key.' + ' . __( 'Active' ) . ' '; } } - + if ( $out != '' ) { ?>
@@ -217,7 +217,7 @@ switch( $_GET['action'] ) {

- + user_id != $current_user->data->ID ) { ?> - - $role_assoc ){ $name = translate_with_context($role_assoc['name']); @@ -288,7 +288,7 @@ switch( $_GET['action'] ) {

- +

@@ -297,9 +297,9 @@ switch( $_GET['action'] ) {

- + - +
@@ -324,7 +324,7 @@ switch( $_GET['action'] ) { WHERE site_id = '{$wpdb->siteid}' AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id AND {$wpdb->registration_log}.IP LIKE ('%{$s}%')"; - } + } if( isset( $_GET['sortby'] ) == false ) { $_GET['sortby'] = 'id'; @@ -407,10 +407,10 @@ switch( $_GET['action'] ) { 'registered' => __('Registered'), 'users' => __('Users') ); - + if( has_filter( 'wpmublogsaction' ) ) $posts_columns['plugins'] = __('Actions'); - + $posts_columns = apply_filters('wpmu_blogs_columns', $posts_columns); $sortby_url = "s="; @@ -427,7 +427,7 @@ switch( $_GET['action'] ) { $column_display_name) { $column_link = " "#fee", "spam" => "#faa", "deleted" => "#f55" ); - foreach ($blog_list as $blog) { + foreach ($blog_list as $blog) { $class = ('alternate' == $class) ? '' : 'alternate'; reset( $status_list ); @@ -455,7 +455,7 @@ switch( $_GET['action'] ) { } echo ""; - $blogname = ( constant( "VHOST" ) == 'yes' ) ? str_replace('.'.$current_site->domain, '', $blog['domain']) : $blog['path']; + $blogname = ( constant( "VHOST" ) == 'yes' ) ? str_replace('.'.$current_site->domain, '', $blog['domain']) : $blog['path']; foreach( $posts_columns as $column_name=>$column_display_name ) { switch($column_name) { case 'id': ?> @@ -467,7 +467,7 @@ switch( $_GET['action'] ) { @@ -476,27 +476,27 @@ switch( $_GET['action'] ) { $controlActions = array(); $controlActions[] = '' . __('Edit') . ''; $controlActions[] = "" . __('Backend') . ''; - + if( get_blog_status( $blog['blog_id'], "deleted" ) == '1' ) $controlActions[] = '' . __('Activate') . ''; else $controlActions[] = '' . __('Deactivate') . ''; - + if( get_blog_status( $blog['blog_id'], "archived" ) == '1' ) $controlActions[] = '' . __('Unarchive') . ''; else $controlActions[] = '' . __('Archive') . ''; - + if( get_blog_status( $blog['blog_id'], "spam" ) == '1' ) $controlActions[] = '' . __('Not Spam') . ''; else $controlActions[] = '' . __("Spam") . ''; - + $controlActions[] = '' . __("Delete") . ''; - + $controlActions[] = "" . __('Visit') . ''; ?> - +
@@ -505,7 +505,7 @@ switch( $_GET['action'] ) { g:i:s a'), $blog['last_updated']); ?> @@ -522,7 +522,7 @@ switch( $_GET['action'] ) { case 'users': ?> 5 ) { @@ -530,7 +530,7 @@ switch( $_GET['action'] ) { $blogusers_warning = __( 'Only showing first 5 users.' ) . ' ' . __( 'More' ) . ''; } foreach ( $blogusers as $key => $val ) { - echo '' . $val->user_login . ' ('.$val->user_email.')
'; + echo '' . $val->user_login . ' ('.$val->user_email.')
'; } if( $blogusers_warning != '' ) { echo '' . $blogusers_warning . '
'; @@ -548,7 +548,7 @@ switch( $_GET['action'] ) { @@ -563,9 +563,9 @@ switch( $_GET['action'] ) { - - - + + + @@ -585,10 +585,10 @@ switch( $_GET['action'] ) { - .domain;?> + .domain;?> domain . $current_site->path ?> - " . __( 'Only the characters a-z and 0-9 recommended.' ) . "

"; ?> diff --git a/wp-admin/ms-upgrade-site.php b/wp-admin/ms-upgrade-site.php index 7afc78ca8..8e16d2f62 100644 --- a/wp-admin/ms-upgrade-site.php +++ b/wp-admin/ms-upgrade-site.php @@ -37,7 +37,7 @@ switch( $_GET['action'] ) { wp_die( "Warning! Problem upgrading {$siteurl}. Your server may not be able to connect to blogs running on it.
Error message: " . $response->get_error_message() ."" ); } do_action( 'after_mu_upgrade', $response ); - do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] ); + do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] ); } } echo ""; @@ -54,7 +54,7 @@ switch( $_GET['action'] ) { echo '

'.__('All Done!').'

'; } break; - default: + default: ?>

ceil($total / $num), + 'total' => ceil($total / $num), 'current' => $apage, 'base' => add_query_arg( 'apage', '%#%' ), 'format' => '' )); - + if ( $user_navigation ) { $user_navigation = sprintf( '' . __( 'Displaying %s–%s of %s' ) . '%s', number_format_i18n( ( $apage - 1 ) * $num + 1 ), @@ -99,7 +99,7 @@ if ( $_GET['updated'] == 'true' ) { $user_navigation ); } - + ?>

site_name ); ?>

@@ -157,11 +157,11 @@ if ( $_GET['updated'] == 'true' ) { "#faa", "deleted" => "#f55" ); - + $bgcolour = ""; foreach ( $status_list as $status => $col ) { if( $user[$status] ) { @@ -177,7 +177,7 @@ if ( $_GET['updated'] == 'true' ) { switch($column_name) { case 'checkbox': ?> ' name='allusers[]' value='' /> - @@ -222,17 +222,17 @@ if ( $_GET['updated'] == 'true' ) { $path = ($val->path == '/') ? '' : $val->path; echo '' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . ''; echo ' '; - + // Edit echo '' . __('Edit') . ' | '; - + // View - echo 'userblog_id, 'spam' ) == 1 ) echo 'style="background-color: #f66" '; echo 'target="_new" href="http://'.$val->domain . $val->path.'">' . __('View') . ''; - - echo '
'; + + echo '
'; } } ?> @@ -247,20 +247,20 @@ if ( $_GET['updated'] == 'true' ) { } endforeach ?> - + - - - + + + + ?> - +
$user_navigation
"; ?> diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 4f0d1ab0f..cf3657922 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -77,7 +77,7 @@ function get_sitestats() { function get_admin_users_for_domain( $sitedomain = '', $path = '' ) { global $wpdb; - + if( $sitedomain == '' ) { $site_id = $wpdb->siteid; } else { @@ -187,7 +187,7 @@ function get_current_user_id() { * Determine if user is a site admin. * * @deprecated Use {@link is_keymaster()} - * + * */ function is_site_admin( $user_login = '' ) { // This function must reside in a file included only if is_multsite() since many plugins @@ -269,7 +269,7 @@ function get_blog_option( $blog_id, $setting, $default = false ) { function add_blog_option( $id, $key, $value ) { $id = (int) $id; - + switch_to_blog($id); add_option( $key, $value ); restore_current_blog(); @@ -278,7 +278,7 @@ function add_blog_option( $id, $key, $value ) { function delete_blog_option( $id, $key ) { $id = (int) $id; - + switch_to_blog($id); delete_option( $key ); restore_current_blog(); @@ -287,7 +287,7 @@ function delete_blog_option( $id, $key ) { function update_blog_option( $id, $key, $value, $refresh = true ) { $id = (int) $id; - + switch_to_blog($id); update_option( $key, $value ); restore_current_blog(); @@ -308,8 +308,8 @@ function switch_to_blog( $new_blog ) { $switched_stack[] = $blog_id; - /* If we're switching to the same blog id that we're on, - * set the right vars, do the associated actions, but skip + /* If we're switching to the same blog id that we're on, + * set the right vars, do the associated actions, but skip * the extra unnecessary work */ if ( $blog_id == $new_blog ) { do_action( 'switch_blog', $blog_id, $blog_id ); @@ -407,7 +407,7 @@ function restore_current_blog() { do_action('switch_blog', $blog_id, $prev_blog_id); - /* If we still have items in the switched stack, consider ourselves still 'switched' */ + /* If we still have items in the switched stack, consider ourselves still 'switched' */ $switched = ( is_array( $switched_stack ) && count( $switched_stack ) > 0 ); return true; } @@ -511,12 +511,12 @@ function get_active_blog_for_user( $user_id ) { // get an active blog for user - function is_user_member_of_blog( $user_id, $blog_id = 0 ) { $user_id = (int) $user_id; $blog_id = (int) $blog_id; - + if( $blog_id == 0 ) { global $wpdb; $blog_id = $wpdb->blogid; } - + $blogs = get_blogs_of_user( $user_id ); if( is_array( $blogs ) ) { return array_key_exists( $blog_id, $blogs ); @@ -906,9 +906,9 @@ function validate_email( $email, $check_domain = true) { function is_email_address_unsafe( $user_email ) { $banned_names = get_site_option( "banned_email_domains" ); - if ($banned_names && !is_array( $banned_names )) { - $banned_names = explode( "\n", $banned_names); - } + if ($banned_names && !is_array( $banned_names )) { + $banned_names = explode( "\n", $banned_names); + } if ( is_array( $banned_names ) && empty( $banned_names ) == false ) { $email_domain = strtolower( substr( $user_email, 1 + strpos( $user_email, '@' ) ) ); foreach( (array) $banned_names as $banned_domain ) { @@ -1116,15 +1116,15 @@ function wpmu_signup_blog($domain, $path, $title, $user, $user_email, $meta = '' $domain = $wpdb->escape($domain); $path = $wpdb->escape($path); $title = $wpdb->escape($title); - + $wpdb->insert( $wpdb->signups, array( - 'domain' => $domain, - 'path' => $path, + 'domain' => $domain, + 'path' => $path, 'title' => $title, - 'user_login' => $user, - 'user_email' => $user_email, + 'user_login' => $user, + 'user_email' => $user_email, 'registered' => current_time('mysql', true), - 'activation_key' => $key, + 'activation_key' => $key, 'meta' => $meta ) ); @@ -1139,15 +1139,15 @@ function wpmu_signup_user($user, $user_email, $meta = '') { $user_email = sanitize_email( $user_email ); $key = substr( md5( time() . rand() . $user_email ), 0, 16 ); $meta = serialize($meta); - + $wpdb->insert( $wpdb->signups, array( - 'domain' => '', - 'path' => '', + 'domain' => '', + 'path' => '', 'title' => '', - 'user_login' => $user, - 'user_email' => $user_email, + 'user_login' => $user, + 'user_email' => $user_email, 'registered' => current_time('mysql', true), - 'activation_key' => $key, + 'activation_key' => $key, 'meta' => $meta ) ); @@ -1343,25 +1343,25 @@ function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) { global $current_site; if( get_site_option( 'registrationnotification' ) != 'yes' ) return false; - + $email = get_site_option( 'admin_email' ); if( is_email($email) == false ) return false; - + $options_site_url = clean_url("http://{$current_site->domain}{$current_site->path}wp-admin/ms-options.php"); switch_to_blog( $blog_id ); $blogname = get_option( 'blogname' ); $siteurl = get_option( 'siteurl' ); restore_current_blog(); - + $msg = sprintf( __( "New Blog: %1s URL: %2s Remote IP: %3s Disable these notifications: %4s"), $blogname, $siteurl, $_SERVER['REMOTE_ADDR'], $options_site_url); $msg = apply_filters( 'newblog_notify_siteadmin', $msg ); - + wp_mail( $email, sprintf( __( "New Blog Registration: %s" ), $siteurl ), $msg ); return true; } @@ -1370,7 +1370,7 @@ function newuser_notify_siteadmin( $user_id ) { global $current_site; if( get_site_option( 'registrationnotification' ) != 'yes' ) return false; - + $email = get_site_option( 'admin_email' ); if( is_email($email) == false ) return false; @@ -1381,7 +1381,7 @@ function newuser_notify_siteadmin( $user_id ) { Remote IP: %2s Disable these notifications: %3s"), $user->user_login, $_SERVER['REMOTE_ADDR'], $options_site_url); - + $msg = apply_filters( 'newuser_notify_siteadmin', $msg ); wp_mail( $email, sprintf(__("New User Registration: %s"), $user->user_login), $msg ); return true; @@ -1416,7 +1416,7 @@ function install_blog($blog_id, $blog_title = '') { require_once( ABSPATH . 'wp-admin/includes/upgrade.php'); - if ( $wpdb->get_results("SELECT ID FROM $wpdb->posts") ) + if ( $wpdb->get_results("SELECT ID FROM $wpdb->posts") ) die(__('

Already Installed

You appear to have already installed WordPress. To reinstall please clear your old database tables first.

') . ''); $wpdb->suppress_errors( false); @@ -1444,7 +1444,7 @@ function install_blog($blog_id, $blog_title = '') { // Default link category $cat_name = __('Blogroll'); $cat_slug = sanitize_title($cat_name); - + $blogroll_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) ); if( $blogroll_id == null ) { $wpdb->insert( $wpdb->sitecategories, array('cat_ID' => 0, 'cat_name' => $cat_name, 'category_nicename' => $cat_slug, 'last_updated' => current_time('mysql', true)) ); @@ -1487,11 +1487,11 @@ function install_blog_defaults($blog_id, $user_id) { $first_post = str_replace( "SITE_URL", clean_url("http://" . $current_site->domain . $current_site->path), $first_post ); $first_post = str_replace( "SITE_NAME", $current_site->site_name, $first_post ); $wpdb->insert( $wpdb->posts, array( - 'post_author' => $user_id, - 'post_date' => $now, + 'post_author' => $user_id, + 'post_date' => $now, 'post_date_gmt' => $now_gmt, - 'post_content' => stripslashes( $first_post ), - 'post_excerpt' => '', + 'post_content' => stripslashes( $first_post ), + 'post_excerpt' => '', 'post_title' => __('Hello world!'), 'post_name' => __('hello-world'), 'post_modified' => $now, @@ -1506,11 +1506,11 @@ function install_blog_defaults($blog_id, $user_id) { // First page $wpdb->insert( $wpdb->posts, array( - 'post_author' => $user_id, - 'post_date' => $now, + 'post_author' => $user_id, + 'post_date' => $now, 'post_date_gmt' => $now_gmt, 'post_content' => get_site_option( 'first_page' ), - 'post_excerpt' => '', + 'post_excerpt' => '', 'post_title' => __('About'), 'post_name' => __('about'), 'post_modified' => $now, @@ -1521,30 +1521,30 @@ function install_blog_defaults($blog_id, $user_id) { 'pinged' => '', 'post_content_filtered' => '' ) ); - + // Flush rules to pick up the new page. $wp_rewrite->init(); $wp_rewrite->flush_rules(); // Default comment $wpdb->insert( $wpdb->comments, array( - 'comment_post_ID' => '1', + 'comment_post_ID' => '1', 'comment_author' => __( get_site_option( 'first_comment_author' ) ), 'comment_author_email' => '', 'comment_author_url' => get_site_option( 'first_comment_url' ), - 'comment_author_IP' => '127.0.0.1', + 'comment_author_IP' => '127.0.0.1', 'comment_date' => $now, - 'comment_date_gmt' => $now_gmt, + 'comment_date_gmt' => $now_gmt, 'comment_content' => __( get_site_option( 'first_comment' ) ) ) ); - + $user = new WP_User($user_id); $wpdb->update( $wpdb->options, array('option_value' => $user->user_email), array('option_name' => 'admin_email') ); // Remove all perms except for the login user. $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix.'user_level') ); $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix.'capabilities') ); - + // Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) TODO: Get previous_blog_id. if ( !is_site_admin( $user->user_login ) && $user_id != 1 ) $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $wpdb->base_prefix.'1_capabilities') ); @@ -1605,7 +1605,7 @@ function wpmu_welcome_user_notification($user_id, $password, $meta = '') { if( !apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta) ) return false; - $welcome_email = get_site_option( 'welcome_user_email' ); + $welcome_email = get_site_option( 'welcome_user_email' ); $user = new WP_User($user_id); @@ -1746,12 +1746,12 @@ function upload_is_user_over_quota( $echo = true ) { } $spaceAllowed = get_space_allowed(); if(empty($spaceAllowed) || !is_numeric($spaceAllowed)) - $spaceAllowed = 10; // Default space allowed is 10 MB - + $spaceAllowed = 10; // Default space allowed is 10 MB + $dirName = BLOGUPLOADDIR; $size = get_dirsize($dirName) / 1024 / 1024; - - if( ($spaceAllowed-$size) < 0 ) { + + if( ($spaceAllowed-$size) < 0 ) { if( $echo ) _e( "Sorry, you have used your space allocation. Please delete some files to upload more files." ); //No space left return true; @@ -1787,7 +1787,7 @@ function fix_import_form_size( $size ) { if( upload_is_user_over_quota( false ) == true ) { return 0; } - + $spaceAllowed = 1024 * 1024 * get_space_allowed(); $dirName = BLOGUPLOADDIR; $dirsize = get_dirsize($dirName) ; @@ -1801,7 +1801,7 @@ function fix_import_form_size( $size ) { if ( !function_exists('graceful_fail') ) : function graceful_fail( $message ) { $message = apply_filters('graceful_fail', $message); - $message_template = apply_filters( 'graceful_fail_template', + $message_template = apply_filters( 'graceful_fail_template', ' @@ -1843,7 +1843,7 @@ class delete_blog { return false; if( $this->reallydeleteblog == true ) { - wpmu_delete_blog( $wpdb->blogid ); + wpmu_delete_blog( $wpdb->blogid ); } } @@ -1862,14 +1862,14 @@ class delete_blog { update_option( "delete_blog_hash", $hash ); $url_delete = get_option( "siteurl" ) . "/wp-admin/options-general.php?page=delete-blog&h=" . $hash; $msg = __("Dear User, -You recently clicked the 'Delete Blog' link on your blog and filled in a +You recently clicked the 'Delete Blog' link on your blog and filled in a form on that page. If you really want to delete your blog, click the link below. You will not be asked to confirm again so only click this link if you are 100% certain: URL_DELETE If you delete your blog, please consider opening a new blog here -some time in the future! (But remember your current blog and username +some time in the future! (But remember your current blog and username are gone forever.) Thanks for using the site, @@ -1932,8 +1932,8 @@ function global_terms( $term_id, $deprecated = '' ) { clean_term_cache($term_id); - return $global_id; -} + return $global_id; +} function redirect_this_site( $deprecated = '' ) { global $current_site; @@ -1944,7 +1944,7 @@ function upload_is_file_too_big( $upload ) { if( is_array( $upload ) == false || defined( 'WP_IMPORTING' ) ) return $upload; if( strlen( $upload[ 'bits' ] ) > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) ) { - return sprintf(__( "This file is too big. Files must be less than %dKb in size.
" ), get_site_option( 'fileupload_maxk', 1500 )); + return sprintf(__( "This file is too big. Files must be less than %dKb in size.
" ), get_site_option( 'fileupload_maxk', 1500 )); } return $upload; @@ -2112,7 +2112,7 @@ function strtolower_usernames( $username, $raw, $strict ) { return strtolower( $username ); } -/* Short circuit the update checks. Make sure update informtion is +/* Short circuit the update checks. Make sure update informtion is stored in wp_sitemeta rather than the options table of individual blogs */ // update_plugins (transient) @@ -2197,8 +2197,8 @@ function redirect_mu_dashboard() { global $current_site, $current_blog; $dashboard_blog = get_dashboard_blog(); - if ( $current_blog->blog_id == $dashboard_blog->blog_id && $dashboard_blog->blog_id != $current_site->blog_id ) { - $protocol = ( is_ssl() ? 'https://' : 'http://' ); + if ( $current_blog->blog_id == $dashboard_blog->blog_id && $dashboard_blog->blog_id != $current_site->blog_id ) { + $protocol = ( is_ssl() ? 'https://' : 'http://' ); wp_redirect( $protocol . $dashboard_blog->domain . trailingslashit( $dashboard_blog->path ) . 'wp-admin/' ); die(); } @@ -2222,7 +2222,7 @@ function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) { $user_id = $current_user->ID; if( $blog_id == 0 ) $blog_id = $wpdb->blogid; - + $local_key = $wpdb->base_prefix . $blog_id . "_" . $key; if( isset( $current_user->$local_key ) ) return true; @@ -2346,7 +2346,7 @@ function mu_filter_plugins_list( $active_plugins ) { if ( !$active_sitewide_plugins ) return $active_plugins; - + $plugins = array_merge( (array) $active_plugins, array_keys( (array) $active_sitewide_plugins ) ); sort( $plugins ); return $plugins; diff --git a/wp-includes/ms-settings.php b/wp-includes/ms-settings.php index 71590ccd2..38bcd3eac 100644 --- a/wp-includes/ms-settings.php +++ b/wp-includes/ms-settings.php @@ -53,7 +53,7 @@ function wpmu_current_site() { $current_site = wp_cache_get( "current_site", "site-options" ); if( $current_site ) return $current_site; - + $wpdb->suppress_errors(); $sites = $wpdb->get_results( "SELECT * FROM $wpdb->site" ); // usually only one site if( count( $sites ) == 1 ) {