summaryrefslogtreecommitdiff
path: root/includes/logging/MoveLogFormatter.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/logging/MoveLogFormatter.php')
-rw-r--r--includes/logging/MoveLogFormatter.php29
1 files changed, 28 insertions, 1 deletions
diff --git a/includes/logging/MoveLogFormatter.php b/includes/logging/MoveLogFormatter.php
index 39130163..7f5e9efa 100644
--- a/includes/logging/MoveLogFormatter.php
+++ b/includes/logging/MoveLogFormatter.php
@@ -37,8 +37,9 @@ class MoveLogFormatter extends LogFormatter {
protected function getMessageKey() {
$key = parent::getMessageKey();
- $params = $this->getMessageParameters();
+ $params = $this->extractParameters();
if ( isset( $params[4] ) && $params[4] === '1' ) {
+ // Messages: logentry-move-move-noredirect, logentry-move-move_redir-noredirect
$key .= '-noredirect';
}
@@ -51,6 +52,7 @@ class MoveLogFormatter extends LogFormatter {
$newname = $this->makePageLink( Title::newFromText( $params[3] ) );
$params[2] = Message::rawParam( $oldname );
$params[3] = Message::rawParam( $newname );
+ unset( $params[4] ); // handled in getMessageKey
return $params;
}
@@ -83,4 +85,29 @@ class MoveLogFormatter extends LogFormatter {
return $this->msg( 'parentheses' )->rawParams( $revert )->escaped();
}
+
+ protected function getParametersForApi() {
+ $entry = $this->entry;
+ $params = $entry->getParameters();
+
+ static $map = array(
+ '4:title:target',
+ '5:bool:suppressredirect',
+ '4::target' => '4:title:target',
+ '5::noredir' => '5:bool:suppressredirect',
+ );
+ foreach ( $map as $index => $key ) {
+ if ( isset( $params[$index] ) ) {
+ $params[$key] = $params[$index];
+ unset( $params[$index] );
+ }
+ }
+
+ if ( !isset( $params['5:bool:suppressredirect'] ) ) {
+ $params['5:bool:suppressredirect'] = false;
+ }
+
+ return $params;
+ }
+
}