Use array for join condition
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 19 Jan 2013 11:20:37 +0000 (12:20 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Sat, 19 Jan 2013 11:20:37 +0000 (12:20 +0100)
Change-Id: I52875ebd5fc67e74439faf703b8119fedd70bfc9

includes/CategoryViewer.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRecentchangeslinked.php

index b3741f8..7678ffe 100644 (file)
@@ -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
+                                       ))
                                )
                        );
 
index 3977673..a8166db 100644 (file)
@@ -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';
index 67a8609..4d57bc7 100644 (file)
@@ -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" );
                                }
                        }