enabled by default.
* Added option to install to MyISAM
* (bug 9250) Remove hardcoded minimum image name length of three characters
+* (bug 10338) Enforce signature length limit in Unicode characters instead of bytes
+
== Bugfixes since 1.10 ==
$wgShowIPinHeader = true; # For non-logged in users
$wgMaxNameChars = 255; # Maximum number of bytes in username
-$wgMaxSigChars = 255; # Maximum number of bytes in signature
+$wgMaxSigChars = 255; # Maximum number of Unicode characters in signature
$wgMaxArticleSize = 2048; # Maximum article size in kilobytes
$wgExtraSubtitle = '';
$nickname = $user->getOption( 'nickname' );
$nickname = $nickname === '' ? $username : $nickname;
- if( strlen( $nickname ) > $wgMaxSigChars ) {
+ if( mb_strlen( $nickname ) > $wgMaxSigChars ) {
$nickname = $username;
wfDebug( __METHOD__ . ": $username has overlong signature.\n" );
} elseif( $user->getBoolOption( 'fancysig' ) !== false ) {
# Validate the signature and clean it up as needed
global $wgMaxSigChars;
- if( strlen( $this->mNick ) > $wgMaxSigChars ) {
+ if( mb_strlen( $this->mNick ) > $wgMaxSigChars ) {
global $wgLang;
$this->mainPrefsForm( 'error',
wfMsg( 'badsiglength', $wgLang->formatNum( $wgMaxSigChars ) ) );
}
global $wgParser, $wgMaxSigChars;
- if( strlen( $this->mNick ) > $wgMaxSigChars ) {
+ if( mb_strlen( $this->mNick ) > $wgMaxSigChars ) {
$invalidSig = $this->tableRow(
' ',
Xml::element( 'span', array( 'class' => 'error' ),
Xml::input( 'wpNick', 25, $this->mNick,
array(
'id' => 'wpNick',
- // Note: $wgMaxSigChars is currently enforced in UTF-8 bytes,
- // but 'maxlength' attribute is enforced in characters.
- // It's still possible to put in an overlong string
- // 'legitimately' by typing non-ASCII chars.
+ // Note: $wgMaxSigChars is enforced in Unicode characters,
+ // both on the backend and now in the browser.
+ // Badly-behaved requests may still try to submit
+ // an overlong string, however.
'maxlength' => $wgMaxSigChars ) )
) .
$invalidSig .