Merge "Language: s/error_log/wfWarn/"
[lhc/web/wiklou.git] / includes / search / SearchHighlighter.php
index 7e5f685..c3c3a8f 100644 (file)
@@ -483,6 +483,7 @@ class SearchHighlighter {
         * the target is category or image, leave it
         *
         * @param array $matches
+        * @return string
         */
        function linkReplace( $matches ) {
                $colon = strpos( $matches[1], ':' );
@@ -559,15 +560,15 @@ class SearchHighlighter {
         * Returns the first few lines of the text
         *
         * @param string $text
-        * @param int $contextlines max number of returned lines
-        * @param int $contextchars average number of characters per line
+        * @param int $contextlines Max number of returned lines
+        * @param int $contextchars Average number of characters per line
         * @return string
         */
-       public function highlightNone( $text, $contextlines, $contextchars) {
+       public function highlightNone( $text, $contextlines, $contextchars ) {
                $match = array();
                $text = ltrim( $text ) . "\n"; // make sure the preg_match may find the last line
-               $text = str_replace( "\n\n", "\n", $text); // remove empty lines
-               preg_match( "/^(.*\n){0,$contextlines}/", $text , $match);
+               $text = str_replace( "\n\n", "\n", $text ); // remove empty lines
+               preg_match( "/^(.*\n){0,$contextlines}/", $text, $match );
                $text = htmlspecialchars( substr( trim( $match[0] ), 0, $contextlines * $contextchars ) ); // trim and limit to max number of chars
                return str_replace( "\n", '<br>', $text );
        }