Make WordPress Core

Changeset 24130


Ignore:
Timestamp:
04/29/2013 02:49:57 PM (14 years ago)
Author:
nacin
Message:

Better logic for preg_match() calls in ms-functions.php. fixes #24222.

File:
1 edited

Legend:

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

    r23794 r24130  
    461461
    462462        // all numeric?
    463         $match = array();
    464         preg_match( '/[0-9]*/', $user_name, $match );
    465         if ( $match[0] == $user_name )
     463        if ( preg_match( '/^[0-9]*$/', $user_name ) )
    466464                $errors->add('user_name', __('Sorry, usernames must have letters too!'));
    467465
    … …  
    573571
    574572        // all numeric?
    575         $match = array();
    576         preg_match( '/[0-9]*/', $blogname, $match );
    577         if ( $match[0] == $blogname )
     573        if ( preg_match( '/^[0-9]*$/', $blogname ) )
    578574                $errors->add('blogname', __('Sorry, site names must have letters too!'));
    579575
Note: See TracChangeset for help on using the changeset viewer.