Remove hack from signature clean-up code; implement the clean-up properly within...
authorRob Church <robchurch@users.mediawiki.org>
Thu, 12 Jan 2006 22:38:55 +0000 (22:38 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Thu, 12 Jan 2006 22:38:55 +0000 (22:38 +0000)
includes/Parser.php
includes/SpecialPreferences.php

index 56f62ca..8776b05 100644 (file)
@@ -3236,7 +3236,7 @@ class Parser
                        # Sig. might contain markup; validate this
                        if( $this->validateSig( $nickname ) !== false ) {
                                # Validated; clean up (if needed) and return it
-                               return( $this->cleanSig( $nickname, true ) );
+                               return( $this->cleanSig( $nickname ) );
                        } else {
                                # Failed to validate; fall back to the default
                                $nickname = $username;
@@ -3269,7 +3269,8 @@ class Parser
         * @param string $text
         * @return string Text
         */
-       function cleanSig( $text, $parsing = false ) {
+       function cleanSig( $text ) {
+       
                $mw = MagicWord::get( MAG_SUBST );
                $substre = $mw->getBaseRegex();
                $subst = $mw->getSynonym( 0 );
@@ -3289,11 +3290,7 @@ class Parser
                );
                
                $text = preg_replace( '/~{3,5}/', '', $text );
-               
-               # TODO: Fix this, it's an ugly hack
-               if( $parsing ) {
-                       $text = $this->replaceVariables( $text );
-               }
+               $text = $this->replaceVariables( $text );
        
                return $text;
        }
index 7a2e76d..23e476e 100644 (file)
@@ -190,7 +190,7 @@ class PreferencesForm {
         * @access private
         */
        function savePreferences() {
-               global $wgUser, $wgLang, $wgOut;
+               global $wgUser, $wgLang, $wgOut, $wgParser;
                global $wgEnableUserEmail, $wgEnableEmail;
                global $wgEmailAuthentication, $wgMinimalPasswordLength;
                global $wgAuth;
@@ -230,7 +230,7 @@ class PreferencesForm {
                # Validate the signature and clean it up as needed
                if( $this->mToggles['fancysig'] ) {
                        if( Parser::validateSig( $this->mNick ) !== false ) {
-                               $this->mNick = Parser::cleanSig( $this->mNick );
+                               $this->mNick = $wgParser->cleanSig( $this->mNick );
                        } else {
                                $this->mainPrefsForm( 'error', wfMsg( 'badsig' ) );
                        }