follow r79649, move the in-block assignment outside.
authorPhilip Tzou <philip@users.mediawiki.org>
Wed, 5 Jan 2011 16:30:10 +0000 (16:30 +0000)
committerPhilip Tzou <philip@users.mediawiki.org>
Wed, 5 Jan 2011 16:30:10 +0000 (16:30 +0000)
includes/api/ApiOpenSearch.php

index 8b382a4..de919b4 100644 (file)
@@ -63,7 +63,8 @@ class ApiOpenSearch extends ApiBase {
                                $namespaces );
                        
                        // if the content language has variants, try to retrieve fallback results
-                       if ( ( $fblimit = $limit - count( $srchres ) ) > 0 ) {
+                       $fblimit = $limit - count( $srchres );
+                       if ( $fblimit > 0 ) {
                                global $wgContLang;
                                $fbsearchs = $wgContLang->autoConvertToAllVariants( $search );
                                $fbsearchs = array_diff( array_unique( $fbsearchs ), ( array ) $search );
@@ -71,7 +72,8 @@ class ApiOpenSearch extends ApiBase {
                                        $_srchres = PrefixSearch::titleSearch( $fbsearch, $fblimit,
                                                $namespaces );
                                        $srchres = array_merge( $srchres, $_srchres );
-                                       if ( ( $fblimit -= - count( $_srchres ) ) == 0 ) {
+                                       $fblimit -= - count( $_srchres );
+                                       if ( $fblimit == 0 ) {
                                                break;
                                        }
                                }