OSDN Git Service

FIX:条件判定の否定演算子が二重に記述されていたためmemberテーブルの値が不正に書き換えられてしまう不具合を修正
[nucleus-jp/nucleus-next.git] / nucleus / libs / SEARCH.php
index 334001e..146b5e4 100644 (file)
  * http://davidaltherr.net/web/php_functions/boolean/funcs.mysql.boolean.txt\r
  *\r
  * @license http://nucleuscms.org/license.txt GNU General Public License\r
- * @copyright Copyright (C) 2002-2009 The Nucleus Group\r
+ * @copyright Copyright (C) 2002-2012 The Nucleus Group\r
  * @version $Id: SEARCH.php 1556 2011-07-11 14:18:48Z ftruscot $\r
  */\r
 \r
 \r
 \r
-class SEARCH {\r
-\r
+class Search\r
+{\r
        var $querystring;\r
        var $marked;\r
        var $inclusive;\r
@@ -50,7 +50,7 @@ class SEARCH {
        function  boolean_sql_select($match){\r
                if (i18n::strlen($this->inclusive) > 0) {\r
                   /* build sql for determining score for each record */\r
-                  $result=i18n::explode(" ",$this->inclusive);\r
+                  $result=preg_split("# #",$this->inclusive);\r
                   for($cth=0;$cth<count($result);$cth++){\r
                           if(i18n::strlen($result[$cth])>=4){\r
                                   $stringsum_long .=  " $result[$cth] ";\r
@@ -174,7 +174,7 @@ class SEARCH {
 \r
                /* apply arbitrary function to all 'word' atoms */\r
 \r
-               $result_a = i18n::explode(' ', $result);\r
+               $result_a = preg_split('# #', $result);\r
 \r
                for($word = 0;$word<count($result_a);$word++)\r
                {\r
@@ -195,7 +195,7 @@ class SEARCH {
        }\r
 \r
        function boolean_sql_where_short($string,$match){\r
-               $match_a = i18n::explode(',',$match);\r
+               $match_a = preg_split('#,#',$match);\r
                for($ith=0;$ith<count($match_a);$ith++){\r
                        $like_a[$ith] = " $match_a[$ith] LIKE '% $string %' ";\r
                }\r
@@ -204,7 +204,7 @@ class SEARCH {
                return $like;\r
        }\r
        function boolean_sql_select_short($string,$match){\r
-               $match_a = i18n::explode(',',$match);\r
+               $match_a = preg_split('#,#',$match);\r
                $score_unit_weight = .2;\r
                for($ith=0;$ith<count($match_a);$ith++){\r
                        $score_a[$ith] =\r