Update the Chinese conversion tables.
[lhc/web/wiklou.git] / includes / SearchOracle.php
index 8f13729..b48d5e6 100644 (file)
 # http://www.gnu.org/copyleft/gpl.html
 
 /**
- * Search engine hook base class for Oracle (ConText).
- * @addtogroup Search
+ * @file
+ * @ingroup Search
  */
 
+/**
+ * Search engine hook base class for Oracle (ConText).
+ * @ingroup Search
+ */
 class SearchOracle extends SearchEngine {
        function __construct($db) {
                $this->db = $db;
@@ -71,9 +75,12 @@ class SearchOracle extends SearchEngine {
         * @private
         */
        function queryNamespaces() {
-               $namespaces = implode(',', $this->namespaces);
-               if ($namespaces == '') {
+               if( is_null($this->namespaces) )
+                       return '';
+               if ( !count( $this->namespaces ) ) {
                        $namespaces = '0';
+               } else {
+                       $namespaces = $this->db->makeList( $this->namespaces );
                }
                return 'AND page_namespace IN (' . $namespaces . ')';
        }
@@ -138,7 +145,10 @@ class SearchOracle extends SearchEngine {
                        'WHERE page_id=si_page AND ' . $match;
        }
 
-       /** @todo document */
+       /** 
+        * Parse a user input search string, and return an SQL fragment to be used 
+        * as part of a WHERE clause
+        */
        function parseQuery($filteredText, $fulltext) {
                global $wgContLang;
                $lc = SearchEngine::legalSearchChars();
@@ -164,9 +174,9 @@ class SearchOracle extends SearchEngine {
                        }
                }
 
-               $searchon = $this->db->strencode(join(',', $q));
+               $searchon = $this->db->addQuotes(join(',', $q));
                $field = $this->getIndexField($fulltext);
-               return " CONTAINS($field, '$searchon', 1) > 0 ";
+               return " CONTAINS($field, $searchon, 1) > 0 ";
        }
 
        /**
@@ -208,6 +218,9 @@ class SearchOracle extends SearchEngine {
        }
 }
 
+/**
+ * @ingroup Search
+ */
 class OracleSearchResultSet extends SearchResultSet {
        function __construct($resultSet, $terms) {
                $this->mResultSet = $resultSet;
@@ -229,5 +242,3 @@ class OracleSearchResultSet extends SearchResultSet {
                return new SearchResult($row);
        }
 }
-
-?>