Legoktm has uploaded a new change for review.
https://gerrit.wikimedia.org/r/78620
Change subject: Use the dbname to detect whether the page is local or not
......................................................................
Use the dbname to detect whether the page is local or not
$isLocal was removed in Ic194f19c047bc920bf9186b6902c42451838b43b
Change-Id: I83c112b30a1ad1f6392abebe60143e02ad57aa88
---
M MassMessage.body.php
1 file changed, 12 insertions(+), 9 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage
refs/changes/20/78620/1
diff --git a/MassMessage.body.php b/MassMessage.body.php
index c5c22bd..b810cea 100644
--- a/MassMessage.body.php
+++ b/MassMessage.body.php
@@ -118,17 +118,11 @@
* @return array
* @fixme Follow redirects on other sites
*/
- public static function normalizeSpamList( $pages, $isLocal ) {
+ public static function normalizeSpamList( $pages ) {
+ global $wgDBname;
$data = array();
foreach ( $pages as $page ) {
- if ( $isLocal ) {
- $title = Title::newFromText( $page['title'] );
- $title = self::followRedirect( $title );
- if ( $title == null ) {
- continue; // Interwiki redirect
- }
- $page['title'] = $title->getFullText();
- }
+
if ( !isset( $page['dbname'] ) ) {
$dbname = self::getDBName( $page['site'] );
if ( $dbname == null ) { // Not set in $wgConf?
@@ -137,6 +131,15 @@
$page['dbname'] = $dbname;
}
+ if ( $page['dbname'] == $wgDBname ) {
+ $title = Title::newFromText( $page['title'] );
+ $title = self::followRedirect( $title );
+ if ( $title == null ) {
+ continue; // Interwiki redirect
+ }
+ $page['title'] = $title->getFullText();
+ }
+
// Use an assoc array to clear dupes
$data[$page['title'] . $page['dbname']] = $page;
}
--
To view, visit https://gerrit.wikimedia.org/r/78620
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I83c112b30a1ad1f6392abebe60143e02ad57aa88
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits