# 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;
* @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 );
);
$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;
}
* @access private
*/
function savePreferences() {
- global $wgUser, $wgLang, $wgOut;
+ global $wgUser, $wgLang, $wgOut, $wgParser;
global $wgEnableUserEmail, $wgEnableEmail;
global $wgEmailAuthentication, $wgMinimalPasswordLength;
global $wgAuth;
# 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' ) );
}