WordPress.org

Make WordPress Core

Changeset 28447


Ignore:
Timestamp:
05/16/2014 02:52:04 PM (7 years ago)
Author:
wonderboymusic
Message:

Eliminate use of extract() in validate_blog_signup():

  • $orig_username does not need to be pulled from wpmu_validate_user_signup() as it is not used in this function.
  • $user does not need to be pulled from wpmu_validate_blog_signup() as it is not used in this function.
  • For the wpmu_validate_user_signup() portion, rename $result and $errors to $user_result and $user_errors` for disambiguation with the blog values below.

See #22400.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-signup.php

    r28446 r28447  
    476476    $result = validate_user_form();
    477477    $user_name = $result['user_name'];
    478     $user_email = $result['user_email']; 
     478    $user_email = $result['user_email'];
    479479    $errors = $result['errors'];
    480480
     
    594594function validate_blog_signup() {
    595595    // Re-validate user info.
    596     $result = wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']);
    597     extract($result);
    598 
    599     if ( $errors->get_error_code() ) {
    600         signup_user($user_name, $user_email, $errors);
     596    $user_result = wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email'] );
     597    $user_name = $user_result['user_name'];
     598    $user_email = $user_result['user_email'];
     599    $user_errors = $user_result['errors'];
     600
     601    if ( $user_errors->get_error_code() ) {
     602        signup_user( $user_name, $user_email, $user_errors );
    601603        return false;
    602604    }
    603605
    604     $result = wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title']);
    605     extract($result);
     606    $result = wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'] );
     607    $domain = $result['domain'];
     608    $path = $result['path'];
     609    $blogname = $result['blogname'];
     610    $blog_title = $result['blog_title'];
     611    $errors = $result['errors'];
    606612
    607613    if ( $errors->get_error_code() ) {
     
    611617
    612618    $public = (int) $_POST['blog_public'];
    613     $meta = array ('lang_id' => 1, 'public' => $public);
     619    $signup_meta = array ('lang_id' => 1, 'public' => $public);
    614620
    615621    /** This filter is documented in wp-signup.php */
    616     $meta = apply_filters( 'add_signup_meta', $meta );
     622    $meta = apply_filters( 'add_signup_meta', $signup_meta );
    617623
    618624    wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta);
Note: See TracChangeset for help on using the changeset viewer.