https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114281
Revision: 114281
Author: maxsem
Date: 2012-03-20 16:49:03 +0000 (Tue, 20 Mar 2012)
Log Message:
-----------
Fixed premature return from a function, comments
Modified Paths:
--------------
trunk/extensions/MobileFrontend/api/ApiQueryExtracts.php
Modified: trunk/extensions/MobileFrontend/api/ApiQueryExtracts.php
===================================================================
--- trunk/extensions/MobileFrontend/api/ApiQueryExtracts.php 2012-03-20
16:40:16 UTC (rev 114280)
+++ trunk/extensions/MobileFrontend/api/ApiQueryExtracts.php 2012-03-20
16:49:03 UTC (rev 114281)
@@ -64,6 +64,7 @@
/**
* OpenSearchXml hook handler
* @param array $results
+ * @return bool
*/
public static function onOpenSearchXml( &$results ) {
global $wgMFExtendOpenSearchXml;
@@ -237,6 +238,7 @@
*
* @param string $text
* @param int $requestedSentenceCount
+ * @return string
*/
private function getFirstSentences( $text, $requestedSentenceCount ) {
wfProfileIn( __METHOD__ );
@@ -254,11 +256,11 @@
$regexp = "/^($sentence){{$requestedSentenceCount}}/u";
$matches = array();
if( preg_match( $regexp, $text, $matches ) ) {
- return $matches[0];
+ $text = $matches[0];
} else {
// Just return the first line
$lines = explode( "\n", $text );
- return trim( $lines[0] );
+ $text = trim( $lines[0] );
}
$text = $this->tidy( $text );
wfProfileOut( __METHOD__ );
@@ -268,6 +270,7 @@
/**
* A simple wrapper around tidy
* @param string $text
+ * @return string
*/
private function tidy( $text ) {
global $wgUseTidy;
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs