X-Git-Url: http://git.cyclocoop.org/%24image?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryBacklinks.php;h=830cc4847774d8fa9d2345d0e304f61c260d4bd6;hb=01e43982ae4b9a61ddfdbe92349eb309f1aaecdb;hp=56cbaac3c18945fe4fe641023db0743f60171915;hpb=d42d6bd868fd5b579080639995e6a7e23851fcf3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index 56cbaac3c1..830cc48477 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -138,7 +138,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { if ( count( $this->cont ) >= 2 ) { $op = $this->params['dir'] == 'descending' ? '<' : '>'; - if ( count( $this->params['namespace'] ) > 1 ) { + if ( $this->params['namespace'] !== null && count( $this->params['namespace'] ) > 1 ) { $this->addWhere( "{$this->bl_from_ns} $op {$this->cont[0]} OR " . "({$this->bl_from_ns} = {$this->cont[0]} AND " . @@ -160,7 +160,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $this->addOption( 'LIMIT', $this->params['limit'] + 1 ); $sort = ( $this->params['dir'] == 'descending' ? ' DESC' : '' ); $orderBy = []; - if ( count( $this->params['namespace'] ) > 1 ) { + if ( $this->params['namespace'] !== null && count( $this->params['namespace'] ) > 1 ) { $orderBy[] = $this->bl_from_ns . $sort; } $orderBy[] = $this->bl_from . $sort; @@ -228,7 +228,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $titleWhere = []; $allRedirNs = []; $allRedirDBkey = []; - /** @var $t Title */ + /** @var Title $t */ foreach ( $this->redirTitles as $t ) { $redirNs = $t->getNamespace(); $redirDBkey = $t->getDBkey(); @@ -246,7 +246,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { $where = "{$this->bl_from} $op= {$this->cont[5]}"; // Don't bother with namespace, title, or from_namespace if it's // otherwise constant in the where clause. - if ( count( $this->params['namespace'] ) > 1 ) { + if ( $this->params['namespace'] !== null && count( $this->params['namespace'] ) > 1 ) { $where = "{$this->bl_from_ns} $op {$this->cont[4]} OR " . "({$this->bl_from_ns} = {$this->cont[4]} AND ($where))"; } @@ -278,7 +278,7 @@ class ApiQueryBacklinks extends ApiQueryGeneratorBase { if ( count( $allRedirDBkey ) > 1 ) { $orderBy[] = $this->bl_title . $sort; } - if ( count( $this->params['namespace'] ) > 1 ) { + if ( $this->params['namespace'] !== null && count( $this->params['namespace'] ) > 1 ) { $orderBy[] = $this->bl_from_ns . $sort; } $orderBy[] = $this->bl_from . $sort;