WordPress.org

Make WordPress Core

Changeset 19852


Ignore:
Timestamp:
02/07/2012 05:44:29 PM (6 years ago)
Author:
nacin
Message:

Simplify matching code. see #19670.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-functions.php

    r19850 r19852  
    437437    $orig_username = $user_name;
    438438    $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
    439     $maybe = array();
    440     preg_match( '/[a-z0-9]+/', $user_name, $maybe );
    441 
    442     if ( $user_name != $orig_username || ( !empty( $maybe ) && $user_name != $maybe[0] ) ) {
     439
     440    if ( $user_name != $orig_username || preg_match( '/[^a-z0-9]/', $user_name ) ) {
    443441        $errors->add( 'user_name', __( 'Only lowercase letters (a-z) and numbers are allowed.' ) );
    444442        $user_name = $orig_username;
Note: See TracChangeset for help on using the changeset viewer.