summaryrefslogtreecommitdiff
path: root/maintenance/deleteEqualMessages.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-12-08 09:55:49 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-12-08 09:55:49 +0100
commit4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch)
treeaf68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /maintenance/deleteEqualMessages.php
parentaf4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff)
Update to MediaWiki 1.22.0
Diffstat (limited to 'maintenance/deleteEqualMessages.php')
-rw-r--r--maintenance/deleteEqualMessages.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/maintenance/deleteEqualMessages.php b/maintenance/deleteEqualMessages.php
index 7048140b..81758913 100644
--- a/maintenance/deleteEqualMessages.php
+++ b/maintenance/deleteEqualMessages.php
@@ -19,7 +19,7 @@
* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that deletes all pages in the MediaWiki namespace
@@ -41,7 +41,7 @@ class DeleteEqualMessages extends Maintenance {
* @param string|bool $langCode See --lang-code option.
*/
protected function fetchMessageInfo( $langCode, array &$messageInfo ) {
- global $wgUser, $wgContLang;
+ global $wgContLang;
if ( $langCode ) {
$this->output( "\n... fetching message info for language: $langCode" );
@@ -70,7 +70,13 @@ class DeleteEqualMessages extends Maintenance {
$default = wfMessage( $key )->inLanguage( $langCode )->useDatabase( false )->plain();
$messageInfo['relevantPages']++;
- if ( $actual === $default ) {
+
+ if (
+ // Exclude messages that are empty by default, such as sitenotice, specialpage
+ // summaries and accesskeys.
+ $default !== '' && $default !== '-' &&
+ $actual === $default
+ ) {
$hasTalk = isset( $statuses['talks'][$key] );
$messageInfo['results'][] = array(
'title' => $key . $titleSuffix,
@@ -152,6 +158,7 @@ class DeleteEqualMessages extends Maintenance {
if ( !$user ) {
$this->error( "Invalid username", true );
}
+ global $wgUser;
$wgUser = $user;
// Hide deletions from RecentChanges
@@ -183,4 +190,4 @@ class DeleteEqualMessages extends Maintenance {
}
$maintClass = "DeleteEqualMessages";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;