Index: trunk/extensions/MobileFrontend/api/ApiQueryExtracts.php |
— | — | @@ -64,6 +64,7 @@ |
65 | 65 | /** |
66 | 66 | * OpenSearchXml hook handler |
67 | 67 | * @param array $results |
| 68 | + * @return bool |
68 | 69 | */ |
69 | 70 | public static function onOpenSearchXml( &$results ) { |
70 | 71 | global $wgMFExtendOpenSearchXml; |
— | — | @@ -237,6 +238,7 @@ |
238 | 239 | * |
239 | 240 | * @param string $text |
240 | 241 | * @param int $requestedSentenceCount |
| 242 | + * @return string |
241 | 243 | */ |
242 | 244 | private function getFirstSentences( $text, $requestedSentenceCount ) { |
243 | 245 | wfProfileIn( __METHOD__ ); |
— | — | @@ -254,11 +256,11 @@ |
255 | 257 | $regexp = "/^($sentence){{$requestedSentenceCount}}/u"; |
256 | 258 | $matches = array(); |
257 | 259 | if( preg_match( $regexp, $text, $matches ) ) { |
258 | | - return $matches[0]; |
| 260 | + $text = $matches[0]; |
259 | 261 | } else { |
260 | 262 | // Just return the first line |
261 | 263 | $lines = explode( "\n", $text ); |
262 | | - return trim( $lines[0] ); |
| 264 | + $text = trim( $lines[0] ); |
263 | 265 | } |
264 | 266 | $text = $this->tidy( $text ); |
265 | 267 | wfProfileOut( __METHOD__ ); |
— | — | @@ -268,6 +270,7 @@ |
269 | 271 | /** |
270 | 272 | * A simple wrapper around tidy |
271 | 273 | * @param string $text |
| 274 | + * @return string |
272 | 275 | */ |
273 | 276 | private function tidy( $text ) { |
274 | 277 | global $wgUseTidy; |