filterredir is mutually exclusive (one value)
authorSam Reed <reedy@users.mediawiki.org>
Sat, 23 Jan 2010 21:25:25 +0000 (21:25 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 23 Jan 2010 21:25:25 +0000 (21:25 +0000)
Change 2nd if for else if in both 1st and 2nd queries

includes/api/ApiQueryBacklinks.php

index 43106e0..e5b0d3a 100644 (file)
@@ -118,7 +118,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                        $this->addWhere( "{$this->bl_from}>={$this->contID}" );
                if ( $this->params['filterredir'] == 'redirects' )
                        $this->addWhereFld( 'page_is_redirect', 1 );
-               if ( $this->params['filterredir'] == 'nonredirects' )
+               else if ( $this->params['filterredir'] == 'nonredirects' )
                        $this->addWhereFld( 'page_is_redirect', 0 );
                $this->addOption( 'LIMIT', $this->params['limit'] + 1 );
                $this->addOption( 'ORDER BY', $this->bl_from );
@@ -168,7 +168,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase {
                }
                if ( $this->params['filterredir'] == 'redirects' )
                        $this->addWhereFld( 'page_is_redirect', 1 );
-               if ( $this->params['filterredir'] == 'nonredirects' )
+               else if ( $this->params['filterredir'] == 'nonredirects' )
                        $this->addWhereFld( 'page_is_redirect', 0 );
                $this->addOption( 'LIMIT', $this->params['limit'] + 1 );
                $this->addOption( 'ORDER BY', $this->bl_sort );