Index: trunk/phase3/includes/Parser.php |
— | — | @@ -3812,7 +3812,7 @@ |
3813 | 3813 | $nickname = $user->getOption( 'nickname' ); |
3814 | 3814 | $nickname = $nickname === '' ? $username : $nickname; |
3815 | 3815 | |
3816 | | - if( strlen( $nickname ) > $wgMaxSigChars ) { |
| 3816 | + if( mb_strlen( $nickname ) > $wgMaxSigChars ) { |
3817 | 3817 | $nickname = $username; |
3818 | 3818 | wfDebug( __METHOD__ . ": $username has overlong signature.\n" ); |
3819 | 3819 | } elseif( $user->getBoolOption( 'fancysig' ) !== false ) { |
Index: trunk/phase3/includes/SpecialPreferences.php |
— | — | @@ -242,7 +242,7 @@ |
243 | 243 | |
244 | 244 | # Validate the signature and clean it up as needed |
245 | 245 | global $wgMaxSigChars; |
246 | | - if( strlen( $this->mNick ) > $wgMaxSigChars ) { |
| 246 | + if( mb_strlen( $this->mNick ) > $wgMaxSigChars ) { |
247 | 247 | global $wgLang; |
248 | 248 | $this->mainPrefsForm( 'error', |
249 | 249 | wfMsg( 'badsiglength', $wgLang->formatNum( $wgMaxSigChars ) ) ); |
— | — | @@ -610,7 +610,7 @@ |
611 | 611 | } |
612 | 612 | |
613 | 613 | global $wgParser, $wgMaxSigChars; |
614 | | - if( strlen( $this->mNick ) > $wgMaxSigChars ) { |
| 614 | + if( mb_strlen( $this->mNick ) > $wgMaxSigChars ) { |
615 | 615 | $invalidSig = $this->tableRow( |
616 | 616 | ' ', |
617 | 617 | Xml::element( 'span', array( 'class' => 'error' ), |
— | — | @@ -632,10 +632,10 @@ |
633 | 633 | Xml::input( 'wpNick', 25, $this->mNick, |
634 | 634 | array( |
635 | 635 | 'id' => 'wpNick', |
636 | | - // Note: $wgMaxSigChars is currently enforced in UTF-8 bytes, |
637 | | - // but 'maxlength' attribute is enforced in characters. |
638 | | - // It's still possible to put in an overlong string |
639 | | - // 'legitimately' by typing non-ASCII chars. |
| 636 | + // Note: $wgMaxSigChars is enforced in Unicode characters, |
| 637 | + // both on the backend and now in the browser. |
| 638 | + // Badly-behaved requests may still try to submit |
| 639 | + // an overlong string, however. |
640 | 640 | 'maxlength' => $wgMaxSigChars ) ) |
641 | 641 | ) . |
642 | 642 | $invalidSig . |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -857,7 +857,7 @@ |
858 | 858 | |
859 | 859 | $wgShowIPinHeader = true; # For non-logged in users |
860 | 860 | $wgMaxNameChars = 255; # Maximum number of bytes in username |
861 | | -$wgMaxSigChars = 255; # Maximum number of bytes in signature |
| 861 | +$wgMaxSigChars = 255; # Maximum number of Unicode characters in signature |
862 | 862 | $wgMaxArticleSize = 2048; # Maximum article size in kilobytes |
863 | 863 | |
864 | 864 | $wgExtraSubtitle = ''; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -101,7 +101,9 @@ |
102 | 102 | enabled by default. |
103 | 103 | * Added option to install to MyISAM |
104 | 104 | * (bug 9250) Remove hardcoded minimum image name length of three characters |
| 105 | +* (bug 10338) Enforce signature length limit in Unicode characters instead of bytes |
105 | 106 | |
| 107 | + |
106 | 108 | == Bugfixes since 1.10 == |
107 | 109 | |
108 | 110 | * (bug 9712) Use Arabic comma in date/time formats for Arabic and Farsi |