Fix bug 145: finish 'exclude redirect' implementation
authorAntoine Musso <hashar@users.mediawiki.org>
Wed, 10 Aug 2005 21:12:00 +0000 (21:12 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Wed, 10 Aug 2005 21:12:00 +0000 (21:12 +0000)
includes/SearchMySQL.php
includes/SpecialSearch.php

index 310a7b9..407a1c7 100644 (file)
@@ -61,9 +61,9 @@ class SearchMySQL extends SearchEngine {
         */
        function queryRedirect() {
                if( $this->showRedirects ) {
-                       return 'AND cur_is_redirect=0';
-               } else {
                        return '';
+               } else {
+                       return 'AND page_is_redirect=0';
                }
        }
        
index fda21c3..4981c74 100644 (file)
@@ -69,8 +69,8 @@ class SpecialSearch {
                } else {
                        $this->namespaces = $this->userNamespaces( $user );
                }
-               
-               $this->searchRedirects = false;
+
+               $this->searchRedirects = $request->getcheck( 'redirs' ) ? true : false;
        }
        
        /**
@@ -164,6 +164,7 @@ class SpecialSearch {
                $search = SearchEngine::create();
                $search->setLimitOffset( $this->limit, $this->offset );
                $search->setNamespaces( $this->namespaces );
+               $search->showRedirects = $this->searchRedirects;
                $titleMatches = $search->searchTitle( $term );
                $textMatches = $search->searchText( $term );