Index: trunk/phase3/includes/SpecialPreferences.php |
— | — | @@ -227,6 +227,11 @@ |
228 | 228 | $needRedirect = false; |
229 | 229 | } |
230 | 230 | |
| 231 | + if( $this->badNickname() ) { |
| 232 | + $this->mainPrefsForm( 'error', wfMsg( 'badsig2' ) ); |
| 233 | + return; |
| 234 | + } |
| 235 | + |
231 | 236 | $wgUser->setOption( 'language', $this->mUserLanguage ); |
232 | 237 | $wgUser->setOption( 'variant', $this->mUserVariant ); |
233 | 238 | $wgUser->setOption( 'nickname', $this->mNick ); |
— | — | @@ -359,6 +364,19 @@ |
360 | 365 | } |
361 | 366 | } |
362 | 367 | } |
| 368 | + |
| 369 | + /** |
| 370 | + * @access private |
| 371 | + */ |
| 372 | + function badNickname() { |
| 373 | + $search = array( '/~~~/', '/~~~~/', '/~~~~~/', '/{{/', '/}}/' ); |
| 374 | + foreach( $search as $item ) { |
| 375 | + if( preg_match( $item, $this->mNick ) > 0 ) { |
| 376 | + return( true ); # We found a reserved expression |
| 377 | + } |
| 378 | + } |
| 379 | + return( false ); |
| 380 | + } |
363 | 381 | |
364 | 382 | /** |
365 | 383 | * @access private |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -389,8 +389,8 @@ |
390 | 390 | * (bug 4436) Update for Turkish language (tr) |
391 | 391 | * (bug 4413) Update of Farsi language file (LanguageFa.php) |
392 | 392 | * Update for LanguageSr (Serbian): magic words |
| 393 | +* (bug 4371) Disallow tilde character in signatures |
393 | 394 | |
394 | | - |
395 | 395 | === Caveats === |
396 | 396 | |
397 | 397 | Some output, particularly involving user-supplied inline HTML, may not |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -633,6 +633,7 @@ |
634 | 634 | 'yourvariant' => 'Variant', |
635 | 635 | 'yournick' => 'Nickname:', |
636 | 636 | 'badsig' => 'Invalid raw signature; check HTML tags.', |
| 637 | +'badsig2' => 'Your signature contains one or more reserved expressions; please remove them.', |
637 | 638 | 'email' => 'E-mail', |
638 | 639 | 'emailforlost' => '<div style="width:30em">* Optional. An e-mail lets others contact you on this site without revealing your address, and lets us send you a new password if you forget it.<br /><br />Your real name will be used to give you attribution for your work.</div>', |
639 | 640 | 'prefs-help-email-enotif' => 'This address is also used to send you e-mail notifications if you enabled the options.', |