/**
* Even uglier hack to maintain backwards compatibilty with IRC bots
- * (bug 34508).
+ * (T36508).
* @see getActionText()
* @return string Text
*/
/**
* Even uglier hack to maintain backwards compatibilty with IRC bots
- * (bug 34508).
+ * (T36508).
* @see getActionText()
* @return string Text
*/
$rawDuration = $parameters['5::duration'];
$rawFlags = $parameters['6::flags'];
}
- $duration = $wgContLang->translateBlockExpiry( $rawDuration );
+ $duration = $wgContLang->translateBlockExpiry(
+ $rawDuration,
+ null,
+ wfTimestamp( TS_UNIX, $entry->getTimestamp() )
+ );
$flags = BlockLogFormatter::formatBlockFlags( $rawFlags, $wgContLang );
$text = wfMessage( 'blocklogentry' )
->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
->rawParams( $target )->inContentLanguage()->escaped();
break;
case 'reblock':
- $duration = $wgContLang->translateBlockExpiry( $parameters['5::duration'] );
+ $duration = $wgContLang->translateBlockExpiry(
+ $parameters['5::duration'],
+ null,
+ wfTimestamp( TS_UNIX, $entry->getTimestamp() )
+ );
$flags = BlockLogFormatter::formatBlockFlags( $parameters['6::flags'], $wgContLang );
$text = wfMessage( 'reblock-logentry' )
->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
*/
protected function extractParameters() {
$entry = $this->entry;
- $params = array();
+ $params = [];
if ( $entry->isLegacy() ) {
foreach ( $entry->getParameters() as $index => $value ) {
* @throws MWException
* @return string
*/
- protected function makePageLink( Title $title = null, $parameters = array(), $html = null ) {
+ protected function makePageLink( Title $title = null, $parameters = [], $html = null ) {
if ( !$this->plaintext ) {
- $link = Linker::link( $title, $html, array(), $parameters );
+ $link = Linker::link( $title, $html, [], $parameters );
} else {
if ( !$title instanceof Title ) {
throw new MWException( "Expected title, got null" );
}
$content = $this->msg( $message )->escaped();
- $attribs = array( 'class' => 'history-deleted' );
+ $attribs = [ 'class' => 'history-deleted' ];
return Html::rawElement( 'span', $attribs, $content );
}
if ( $this->plaintext ) {
return $content;
}
- $attribs = array( 'class' => 'history-deleted' );
+ $attribs = [ 'class' => 'history-deleted' ];
return Html::rawElement( 'span', $attribs, $content );
}
* @return array Array of titles that should be preloaded with LinkBatch
*/
public function getPreloadTitles() {
- return array();
+ return [];
}
/**
* @return array
*/
public function formatParametersForApi() {
- $logParams = array();
+ $logParams = [];
foreach ( $this->getParametersForApi() as $key => $value ) {
$vals = explode( ':', $key, 3 );
if ( count( $vals ) !== 3 ) {
if ( $type === 'msg-content' ) {
$msg->inContentLanguage();
}
- $value = array();
+ $value = [];
$value["{$name}_key"] = $msg->getKey();
if ( $msg->getParams() ) {
$value["{$name}_params"] = $msg->getParams();
case 'title-link':
$title = Title::newFromText( $value );
if ( $title ) {
- $value = array();
+ $value = [];
ApiQueryBase::addTitleInfo( $value, $title, "{$name}_" );
}
return $value;
break;
}
- return array( $name => $value );
+ return [ $name => $value ];
}
}
$params = $this->entry->getParameters();
- Hooks::run( 'LogLine', array( $type, $subtype, $title, $params,
- &$this->comment, &$this->revert, $this->entry->getTimestamp() ) );
+ Hooks::run( 'LogLine', [ $type, $subtype, $title, $params,
+ &$this->comment, &$this->revert, $this->entry->getTimestamp() ] );
return $this->revert;
}