X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/fa11948979fd6a4ea5705dc613b239699a459db3..9e77185fafaf4e60e2b73821e0e4b9b1a11fb85f:/wp-signup.php diff --git a/wp-signup.php b/wp-signup.php index 0ecee1e1..94722e34 100644 --- a/wp-signup.php +++ b/wp-signup.php @@ -87,8 +87,8 @@ do_action( 'before_signup_form' ); * @param string $blog_title The new site title * @param array $errors */ -function show_blog_form($blogname = '', $blog_title = '', $errors = '') { - global $current_site; +function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) { + $current_site = get_current_site(); // Blog name if ( !is_subdomain_install() ) echo ''; @@ -188,7 +188,7 @@ function show_user_form($user_name = '', $user_email = '', $errors = '') { get_error_message('user_email') ) { ?>
-' . $errmsg . '
'; @@ -225,8 +225,7 @@ function validate_user_form() { * @param string $blog_title The new blog title * @param array $errors */ -function signup_another_blog($blogname = '', $blog_title = '', $errors = '') { - global $current_site; +function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) { $current_user = wp_get_current_user(); if ( ! is_wp_error($errors) ) { @@ -258,7 +257,7 @@ function signup_another_blog($blogname = '', $blog_title = '', $errors = '') { $blog_title = $filtered_results['blog_title']; $errors = $filtered_results['errors']; - echo '' . __( 'There was a problem, please correct the form below and try again.' ) . '
'; @@ -316,7 +315,13 @@ function validate_another_blog_signup() { die(); $result = validate_blog_form(); - extract($result); + + // Extracted values set/overwrite globals. + $domain = $result['domain']; + $path = $result['path']; + $blogname = $result['blogname']; + $blog_title = $result['blog_title']; + $errors = $result['errors']; if ( $errors->get_error_code() ) { signup_another_blog($blogname, $blog_title, $errors); @@ -338,7 +343,7 @@ function validate_another_blog_signup() { * * @param array $blog_meta_defaults An array of default blog meta variables. */ - $meta = apply_filters( 'signup_create_blog_meta', $blog_meta_defaults ); + $meta_defaults = apply_filters( 'signup_create_blog_meta', $blog_meta_defaults ); /** * Filter the new default site meta variables. * @@ -351,7 +356,7 @@ function validate_another_blog_signup() { * @type int $blog_public Whether search engines should be discouraged from indexing the site. 1 for true, 0 for false. * } */ - $meta = apply_filters( 'add_signup_meta', $meta ); + $meta = apply_filters( 'add_signup_meta', $meta_defaults ); wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid ); confirm_another_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta); @@ -395,8 +400,8 @@ function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $ * @param string $user_email The user's email * @param array $errors */ -function signup_user($user_name = '', $user_email = '', $errors = '') { - global $current_site, $active_signup; +function signup_user( $user_name = '', $user_email = '', $errors = '' ) { + global $active_signup; if ( !is_wp_error($errors) ) $errors = new WP_Error(); @@ -429,8 +434,8 @@ function signup_user($user_name = '', $user_email = '', $errors = '') { ?> -