Index: trunk/phase3/includes/api/ApiQuerySearch.php |
— | — | @@ -139,10 +139,8 @@ |
140 | 140 | if ( isset( $prop['timestamp'] ) ) { |
141 | 141 | $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $result->getTimestamp() ); |
142 | 142 | } |
143 | | - if ( !is_null( $result->getScore() ) ) { |
144 | | - if ( isset( $prop['score'] ) ) { |
145 | | - $vals['score'] = $result->getScore(); |
146 | | - } |
| 143 | + if ( !is_null( $result->getScore() ) && isset( $prop['score'] ) ) { |
| 144 | + $vals['score'] = $result->getScore(); |
147 | 145 | } |
148 | 146 | if ( isset( $prop['titlesnippet'] ) ) { |
149 | 147 | $vals['titlesnippet'] = $result->getTitleSnippet( $terms ); |
— | — | @@ -163,10 +161,8 @@ |
164 | 162 | $vals['sectionsnippet'] = $result->getSectionSnippet(); |
165 | 163 | } |
166 | 164 | } |
167 | | - if ( isset( $prop['hasrelated'] ) ) { |
168 | | - if ( $result->hasRelated() ) { |
169 | | - $vals['hasrelated'] = ""; |
170 | | - } |
| 165 | + if ( isset( $prop['hasrelated'] ) && $result->hasRelated() ) { |
| 166 | + $vals['hasrelated'] = ""; |
171 | 167 | } |
172 | 168 | |
173 | 169 | // Add item to results and see whether it fits |