Index: trunk/phase3/includes/api/ApiOpenSearch.php |
— | — | @@ -63,7 +63,8 @@ |
64 | 64 | $namespaces ); |
65 | 65 | |
66 | 66 | // if the content language has variants, try to retrieve fallback results |
67 | | - if ( ( $fblimit = $limit - count( $srchres ) ) > 0 ) { |
| 67 | + $fblimit = $limit - count( $srchres ); |
| 68 | + if ( $fblimit > 0 ) { |
68 | 69 | global $wgContLang; |
69 | 70 | $fbsearchs = $wgContLang->autoConvertToAllVariants( $search ); |
70 | 71 | $fbsearchs = array_diff( array_unique( $fbsearchs ), ( array ) $search ); |
— | — | @@ -71,7 +72,8 @@ |
72 | 73 | $_srchres = PrefixSearch::titleSearch( $fbsearch, $fblimit, |
73 | 74 | $namespaces ); |
74 | 75 | $srchres = array_merge( $srchres, $_srchres ); |
75 | | - if ( ( $fblimit -= - count( $_srchres ) ) == 0 ) { |
| 76 | + $fblimit -= - count( $_srchres ); |
| 77 | + if ( $fblimit == 0 ) { |
76 | 78 | break; |
77 | 79 | } |
78 | 80 | } |