From 31f3f93d9f57abe46bdb89f56b98170b1ef0a9b1 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 19 Jan 2013 12:20:37 +0100 Subject: [PATCH] Use array for join condition Change-Id: I52875ebd5fc67e74439faf703b8119fedd70bfc9 --- includes/CategoryViewer.php | 5 ++++- includes/specials/SpecialRecentchanges.php | 7 +++++-- includes/specials/SpecialRecentchangeslinked.php | 8 ++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index b3741f8a77..7678ffe080 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -312,7 +312,10 @@ class CategoryViewer extends ContextSource { ), array( 'categorylinks' => array( 'INNER JOIN', 'cl_from = page_id' ), - 'category' => array( 'LEFT JOIN', 'cat_title = page_title AND page_namespace = ' . NS_CATEGORY ) + 'category' => array( 'LEFT JOIN', array( + 'cat_title = page_title', + 'page_namespace' => NS_CATEGORY + )) ) ); diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 39776735c0..a8166db5ce 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -387,8 +387,11 @@ class SpecialRecentChanges extends IncludableSpecialPage { $tables[] = 'watchlist'; $fields[] = 'wl_user'; $fields[] = 'wl_notificationtimestamp'; - $join_conds['watchlist'] = array('LEFT JOIN', - "wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace"); + $join_conds['watchlist'] = array('LEFT JOIN', array( + 'wl_user' => $uid, + 'wl_title=rc_title', + 'wl_namespace=rc_namespace' + )); } if ( $this->getUser()->isAllowed( 'rollback' ) ) { $tables[] = 'page'; diff --git a/includes/specials/SpecialRecentchangeslinked.php b/includes/specials/SpecialRecentchangeslinked.php index 67a8609d67..4d57bc7804 100644 --- a/includes/specials/SpecialRecentchangeslinked.php +++ b/includes/specials/SpecialRecentchangeslinked.php @@ -102,7 +102,11 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges { if( $uid ) { $tables[] = 'watchlist'; $select[] = 'wl_user'; - $join_conds['watchlist'] = array( 'LEFT JOIN', "wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace" ); + $join_conds['watchlist'] = array( 'LEFT JOIN', array( + 'wl_user' => $uid, + 'wl_title=rc_title', + 'wl_namespace=rc_namespace' + )); } if ( $this->getUser()->isAllowed( 'rollback' ) ) { $tables[] = 'page'; @@ -175,7 +179,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges { $subconds["rc_namespace"] = $link_ns; $subjoin = "rc_title = {$pfx}_to"; } else { - $subjoin = "rc_namespace = {$pfx}_namespace AND rc_title = {$pfx}_title"; + $subjoin = array( "rc_namespace = {$pfx}_namespace", "rc_title = {$pfx}_title" ); } } -- 2.20.1