StringUtils: Clarify that isValidRegex is for PCRE regexps
[lhc/web/wiklou.git] / includes / search / SqlSearchResult.php
index 25e87e7..f470dbb 100644 (file)
@@ -22,7 +22,7 @@
  * @ingroup Search
  */
 
-class SqlSearchResult extends SearchResult {
+class SqlSearchResult extends RevisionSearchResult {
        /** @var string[] */
        private $terms;
 
@@ -32,7 +32,7 @@ class SqlSearchResult extends SearchResult {
         * @param string[] $terms list of parsed terms
         */
        public function __construct( Title $title, array $terms ) {
-               $this->initFromTitle( $title );
+               parent::__construct( $title );
                $this->terms = $terms;
        }
 
@@ -51,18 +51,15 @@ class SqlSearchResult extends SearchResult {
                global $wgAdvancedSearchHighlighting;
                $this->initText();
 
-               // TODO: make highliter take a content object. Make ContentHandler a factory for SearchHighliter.
-               list( $contextlines, $contextchars ) = $this->searchEngine->userHighlightPrefs();
-
                $h = new SearchHighlighter();
                if ( count( $this->terms ) > 0 ) {
                        if ( $wgAdvancedSearchHighlighting ) {
-                               return $h->highlightText( $this->mText, $this->terms, $contextlines, $contextchars );
+                               return $h->highlightText( $this->mText, $this->terms );
                        } else {
-                               return $h->highlightSimple( $this->mText, $this->terms, $contextlines, $contextchars );
+                               return $h->highlightSimple( $this->mText, $this->terms );
                        }
                } else {
-                       return $h->highlightNone( $this->mText, $contextlines, $contextchars );
+                       return $h->highlightNone( $this->mText );
                }
        }