From a1789ddde42033f1b05cc4929491214ee6e79383 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 17 Dec 2015 09:15:42 +0100 Subject: Update to MediaWiki 1.26.0 --- includes/logging/ProtectLogFormatter.php | 70 ++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 includes/logging/ProtectLogFormatter.php (limited to 'includes/logging/ProtectLogFormatter.php') diff --git a/includes/logging/ProtectLogFormatter.php b/includes/logging/ProtectLogFormatter.php new file mode 100644 index 00000000..5327e072 --- /dev/null +++ b/includes/logging/ProtectLogFormatter.php @@ -0,0 +1,70 @@ +entry->getSubtype(); + if ( $subtype === 'move_prot' ) { + $params = $this->extractParameters(); + return array( Title::newFromText( $params[3] ) ); + } + return array(); + } + + protected function getMessageParameters() { + $params = parent::getMessageParameters(); + + $subtype = $this->entry->getSubtype(); + if ( $subtype === 'move_prot' ) { + $oldname = $this->makePageLink( Title::newFromText( $params[3] ), array( 'redirect' => 'no' ) ); + $params[3] = Message::rawParam( $oldname ); + } + + return $params; + } + + protected function getParametersForApi() { + $entry = $this->entry; + $params = $entry->getParameters(); + + static $map = array( + // param keys for move_prot sub type + '4:title:oldtitle', + '4::oldtitle' => '4:title:oldtitle', + ); + foreach ( $map as $index => $key ) { + if ( isset( $params[$index] ) ) { + $params[$key] = $params[$index]; + unset( $params[$index] ); + } + } + + return $params; + } +} -- cgit v1.2.3-54-g00ecf