* Change order of things in pre-save transform, so that the forced substitution in...
authorRob Church <robchurch@users.mediawiki.org>
Sat, 7 Jan 2006 23:37:40 +0000 (23:37 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Sat, 7 Jan 2006 23:37:40 +0000 (23:37 +0000)
* Remove now-redundant message from Language.php
* Improve signature validation in user preferences; poor XML causes the user to be screamed at; signatures still silent-cleaned upon changing

includes/Parser.php
includes/SpecialPreferences.php
languages/Language.php

index 8c76343..a166238 100644 (file)
@@ -3133,14 +3133,6 @@ class Parser
        function pstPass2( $text, &$user ) {
                global $wgContLang, $wgLocaltimezone;
 
-               # Variable replacement
-               # Because mOutputType is OT_WIKI, this will only process {{subst:xxx}} type tags
-               $text = $this->replaceVariables( $text );
-
-               # Signatures
-               #
-               $sigText = $this->getUserSig( $user );
-
                /* Note: This is the timestamp saved as hardcoded wikitext to
                 * the database, we use $wgContLang here in order to give
                 * everyone the same signiture and use the default one rather
@@ -3156,10 +3148,16 @@ class Parser
                        putenv( 'TZ='.$oldtz );
                }
 
+               # Signatures
+               $sigText = $this->getUserSig( $user );
                $text = preg_replace( '/~~~~~/', $d, $text );
                $text = preg_replace( '/~~~~/', "$sigText $d", $text );
                $text = preg_replace( '/~~~/', $sigText, $text );
 
+               # Variable replacement
+               # Because mOutputType is OT_WIKI, this will only process {{subst:xxx}} type tags
+               $text = $this->replaceVariables( $text );
+
                # Context links: [[|name]] and [[name (context)|]]
                #
                global $wgLegalTitleChars;
index 69705a5..3f80317 100644 (file)
@@ -227,8 +227,14 @@ class PreferencesForm {
                        $needRedirect = false;
                }
 
-               # Clean up the signature a little
-               $this->mNick = Parser::cleanSig( $this->mNick );
+               # Validate the signature and clean it up as needed
+               if( $this->mToggles['fancysig'] ) {
+                       if( Parser::validateSig( $this->mNick ) ) {
+                               $this->mNick = Parser::cleanSig( $this->mNick );
+                       } else {
+                               $this->mainPrefsForm( 'error', wfMsg( 'badsig' ) );
+                       }
+               }
 
                $wgUser->setOption( 'language', $this->mUserLanguage );
                $wgUser->setOption( 'variant', $this->mUserVariant );
index 7f4c5c1..e09b493 100644 (file)
@@ -13,7 +13,7 @@ if( defined( 'MEDIAWIKI' ) ) {
 # See http://meta.wikipedia.org/wiki/MediaWiki_namespace
 #
 # NOTE TO TRANSLATORS: Do not copy this whole file when making translations!
-# A lot of common constants and a base class with inheritable methods are
+# A lot of common constants and a base class with inheritable mebathods are
 # defined here, which should not be redefined. See the other LanguageXx.php
 # files for examples.
 #
@@ -631,7 +631,6 @@ Your account has been created. Don't forget to change your {{SITENAME}} preferen
 'yourvariant'  => 'Variant',
 'yournick'             => 'Nickname:',
 'badsig'               => 'Invalid raw signature; check HTML tags.',
-'badsig2'              => 'Your signature contains one or more reserved expressions; please remove them.',
 'email'                        => 'E-mail',
 '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>',
 'prefs-help-email-enotif' => 'This address is also used to send you e-mail notifications if you enabled the options.',