X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiQueryBacklinks.php;h=35cb83ace3170b1dee5ad74cf3c3886604d16264;hp=54be254d5945d9dd4a055f7584686fc08405191e;hb=faf7cc4a09848c538320bd2b9067b1a77c0a0183;hpb=5fa4cdf860c79b32ab6ef034c6d9420c2727f695 diff --git a/includes/api/ApiQueryBacklinks.php b/includes/api/ApiQueryBacklinks.php index 54be254d59..35cb83ace3 100644 --- a/includes/api/ApiQueryBacklinks.php +++ b/includes/api/ApiQueryBacklinks.php @@ -1,9 +1,5 @@ @gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -138,7 +134,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 +156,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; @@ -246,7 +242,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 +274,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;