Remove extra parenthesis on where conditions
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 4 Jan 2014 21:03:02 +0000 (22:03 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Sat, 4 Jan 2014 21:03:02 +0000 (22:03 +0100)
No need for parenthesis there, because Database::makeList always add
parenthesis around raw where clauses.

Also replaced hard coded quotes by Database::addQuotes

Change-Id: Idcfea54383ac1ba22daa38fba81b883dc0d883f6

includes/specials/SpecialProtectedpages.php
maintenance/fixDoubleRedirects.php

index 214fbd9..09284d0 100644 (file)
@@ -425,8 +425,8 @@ class ProtectedPagesPager extends AlphabeticPager {
 
        function getQueryInfo() {
                $conds = $this->mConds;
-               $conds[] = '(pr_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
-                       'OR pr_expiry IS NULL)';
+               $conds[] = 'pr_expiry > ' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
+                       'OR pr_expiry IS NULL';
                $conds[] = 'page_id=pr_page';
                $conds[] = 'pr_type=' . $this->mDb->addQuotes( $this->type );
 
index 523be7e..8ae5a5a 100644 (file)
@@ -71,7 +71,7 @@ class FixDoubleRedirects extends Maintenance {
                        'rd_from = pa.page_id',
                        'rd_namespace = pb.page_namespace',
                        'rd_title = pb.page_title',
-                       '(rd_interwiki IS NULL OR rd_interwiki = "")', // bug 40352
+                       'rd_interwiki IS NULL OR rd_interwiki = ' . $dbr->addQuotes( '' ), // bug 40352
                        'pb.page_is_redirect' => 1,
                );