Index: trunk/phase3/includes/User.php |
— | — | @@ -585,10 +585,13 @@ |
586 | 586 | return false; |
587 | 587 | } |
588 | 588 | |
589 | | - if( preg_match( '/[' . preg_quote( $wgInvalidUsernameCharacters, '/' ) . ']/', $name ) ) { |
590 | | - wfDebugLog( 'username', __METHOD__ . |
591 | | - ": '$name' invalid due to wgInvalidUsernameCharacters" ); |
592 | | - return false; |
| 589 | + // Preg yells if you try to give it an empty string |
| 590 | + if( $wgInvalidUsernameCharacters ) { |
| 591 | + if( preg_match( '/[' . preg_quote( $wgInvalidUsernameCharacters, '/' ) . ']/', $name ) ) { |
| 592 | + wfDebugLog( 'username', __METHOD__ . |
| 593 | + ": '$name' invalid due to wgInvalidUsernameCharacters" ); |
| 594 | + return false; |
| 595 | + } |
593 | 596 | } |
594 | 597 | |
595 | 598 | return self::isUsableName( $name ); |