Index: trunk/phase3/includes/User.php |
— | — | @@ -599,20 +599,31 @@ |
600 | 600 | * either by batch processes or by user accounts which have |
601 | 601 | * already been created. |
602 | 602 | * |
603 | | - * Additional character blacklisting may be added here |
604 | | - * rather than in isValidUserName() to avoid disrupting |
605 | | - * existing accounts. |
| 603 | + * Additional blacklisting may be added here rather than in |
| 604 | + * isValidUserName() to avoid disrupting existing accounts. |
606 | 605 | * |
607 | 606 | * @param $name \string String to match |
608 | 607 | * @return \bool True or false |
609 | 608 | */ |
610 | 609 | static function isCreatableName( $name ) { |
611 | 610 | global $wgInvalidUsernameCharacters; |
612 | | - return |
613 | | - self::isUsableName( $name ) && |
614 | 611 | |
615 | | - // Registration-time character blacklisting... |
616 | | - !preg_match( '/[' . preg_quote( $wgInvalidUsernameCharacters, '/' ) . ']/', $name ); |
| 612 | + // Ensure that the username isn't longer than 235 bytes, so that |
| 613 | + // (at least for the builtin skins) user javascript and css files |
| 614 | + // will work. (bug 23080) |
| 615 | + if( strlen( $name ) > 235 ) { |
| 616 | + wfDebugLog( 'username', __METHOD__ . |
| 617 | + ": '$name' invalid due to length" ); |
| 618 | + return false; |
| 619 | + } |
| 620 | + |
| 621 | + if( preg_match( '/[' . preg_quote( $wgInvalidUsernameCharacters, '/' ) . ']/', $name ) ) { |
| 622 | + wfDebugLog( 'username', __METHOD__ . |
| 623 | + ": '$name' invalid due to wgInvalidUsernameCharacters" ); |
| 624 | + return false; |
| 625 | + } |
| 626 | + |
| 627 | + return self::isUsableName( $name ); |
617 | 628 | } |
618 | 629 | |
619 | 630 | /** |