r84273 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84272‎ | r84273 | r84274 >
Date:22:03, 18 March 2011
Author:happy-melon
Status:ok
Tags:
Comment:
Follow-ups to r84258.
Modified paths:
  • /trunk/extensions/GlobalBlocking/GlobalBlocking.class.php (modified) (history)
  • /trunk/extensions/GlobalBlocking/SpecialGlobalBlockList.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -2979,16 +2979,16 @@
29802980 * @return String
29812981 */
29822982 public function formatExpiry( $expiry, $format = true ) {
2983 - static $dbr, $msg;
2984 - if( !$dbr ){
2985 - $dbr = wfGetDB( DB_SLAVE );
2986 - $msg = wfMessage( 'infiniteblock' );
 2983+ static $infinity, $infinityMsg;
 2984+ if( $infinity === null ){
 2985+ $infinityMsg = wfMessage( 'infiniteblock' );
 2986+ $infinity = wfGetDB( DB_SLAVE )->getInfinity();
29872987 }
29882988
2989 - if ( $expiry == '' || $expiry == $dbr->getInfinity() ) {
 2989+ if ( $expiry == '' || $expiry == $infinity ) {
29902990 return $format === true
2991 - ? $msg
2992 - : $dbr->getInfinity();
 2991+ ? $infinityMsg
 2992+ : $infinity;
29932993 } else {
29942994 return $format === true
29952995 ? $this->timeanddate( $expiry )
Index: trunk/extensions/GlobalBlocking/GlobalBlocking.class.php
@@ -51,6 +51,7 @@
5252 $expiry = Block::decodeExpiry( $block->gb_expiry );
5353 $expiry = wfMsgExt(
5454 'expiringblock',
 55+ 'parseinline',
5556 $wgLang->date( $expiry ),
5657 $wgLang->time( $expiry )
5758 );
Index: trunk/extensions/GlobalBlocking/SpecialGlobalBlockList.php
@@ -142,6 +142,7 @@
143143 $expiry = Block::decodeExpiry( $expiry );
144144 $options[] = wfMsgExt(
145145 'expiringblock',
 146+ 'parseinline',
146147 $wgLang->date( $expiry ),
147148 $wgLang->time( $expiry )
148149 );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84258More cleanup in Block.php. Push Block::encodeExpiry() and Block::decodeExpir...happy-melon19:15, 18 March 2011

Status & tagging log