From: Roan Kattouw Date: Wed, 9 Nov 2011 17:20:05 +0000 (+0000) Subject: (bug 32256) API list=search stops at first invalid result. Thanks to Lupo for finding... X-Git-Tag: 1.31.0-rc.0~26618 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=2c5c3caa821414a1ba881362c499d169d1ab14ea;p=lhc%2Fweb%2Fwiklou.git (bug 32256) API list=search stops at first invalid result. Thanks to Lupo for finding the cause of the bug: in the code path for invalid titles, the iterator wasn't moved to the next result, so the loop kept processing the same result until it hit the limit. --- diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index 8f7b725e3d..6f08e69d87 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -129,6 +129,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { // Silently skip broken and missing titles if ( $result->isBrokenTitle() || $result->isMissingRevision() ) { + $result = $matches->next(); continue; }