| @@ 159-163 (lines=5) @@ | ||
| 156 | $query_select['id_search'] = '{int:id_search}'; |
|
| 157 | ||
| 158 | $count = 0; |
|
| 159 | foreach ($words['words'] as $regularWord) |
|
| 160 | { |
|
| 161 | $query_where[] = 'm.body' . (in_array($regularWord, $query_params['excluded_words']) ? ' NOT' : '') . (empty($modSettings['search_match_words']) || $search_data['no_regexp'] ? ' LIKE ' : ' RLIKE ') . '{string:complex_body_' . $count . '}'; |
|
| 162 | $query_params['complex_body_' . $count++] = empty($modSettings['search_match_words']) || $search_data['no_regexp'] ? '%' . strtr($regularWord, array('_' => '\\_', '%' => '\\%')) . '%' : '[[:<:]]' . addcslashes(preg_replace(array('/([\[\]$.+*?|{}()])/'), array('[$1]'), $regularWord), '\\\'') . '[[:>:]]'; |
|
| 163 | } |
|
| 164 | ||
| 165 | if ($query_params['user_query']) |
|
| 166 | $query_where[] = '{raw:user_query}'; |
|
| @@ 177-181 (lines=5) @@ | ||
| 174 | ||
| 175 | $count = 0; |
|
| 176 | if (empty($modSettings['search_simple_fulltext'])) |
|
| 177 | foreach ($words['words'] as $regularWord) |
|
| 178 | { |
|
| 179 | $query_where[] = 'm.body' . (in_array($regularWord, $query_params['excluded_words']) ? ' NOT' : '') . (empty($modSettings['search_match_words']) || $search_data['no_regexp'] ? ' LIKE ' : 'RLIKE') . '{string:complex_body_' . $count . '}'; |
|
| 180 | $query_params['complex_body_' . $count++] = empty($modSettings['search_match_words']) || $search_data['no_regexp'] ? '%' . strtr($regularWord, array('_' => '\\_', '%' => '\\%')) . '%' : '[[:<:]]' . addcslashes(preg_replace(array('/([\[\]$.+*?|{}()])/'), array('[$1]'), $regularWord), '\\\'') . '[[:>:]]'; |
|
| 181 | } |
|
| 182 | ||
| 183 | if ($query_params['user_query']) |
|
| 184 | $query_where[] = '{raw:user_query}'; |
|