Disable template expansion in message <autoblocker>.
authorLiangent <liangent@gmail.com>
Thu, 10 Jan 2013 06:18:27 +0000 (14:18 +0800)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 18 Jan 2013 11:07:36 +0000 (11:07 +0000)
Sometimes sysops put template calls in block messages and they will be
expanded in the <blockedtext> interface. However in corresponding
autoblocks, template calls get expanded to long strings and truncated.

Change-Id: I3150192ec8c95d2e4807f058a855856e467145de

includes/Block.php

index f3290b6..b81cf3a 100644 (file)
@@ -696,7 +696,7 @@ class Block {
                wfDebug( "Autoblocking {$this->getTarget()}@" . $autoblockIP . "\n" );
                $autoblock->setTarget( $autoblockIP );
                $autoblock->setBlocker( $this->getBlocker() );
-               $autoblock->mReason = wfMessage( 'autoblocker', $this->getTarget(), $this->mReason )->inContentLanguage()->text();
+               $autoblock->mReason = wfMessage( 'autoblocker', $this->getTarget(), $this->mReason )->inContentLanguage()->plain();
                $timestamp = wfTimestampNow();
                $autoblock->mTimestamp = $timestamp;
                $autoblock->mAuto = 1;