| @@ 166-170 (lines=5) @@ | ||
| 163 | $query_select['id_search'] = '{int:id_search}'; |
|
| 164 | ||
| 165 | $count = 0; |
|
| 166 | foreach ($words['words'] as $regularWord) |
|
| 167 | { |
|
| 168 | $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 . '}'; |
|
| 169 | $query_params['complex_body_' . $count++] = empty($modSettings['search_match_words']) || $search_data['no_regexp'] ? '%' . strtr($regularWord, array('_' => '\\_', '%' => '\\%')) . '%' : '[[:<:]]' . addcslashes(preg_replace(array('/([\[\]$.+*?|{}()])/'), array('[$1]'), $regularWord), '\\\'') . '[[:>:]]'; |
|
| 170 | } |
|
| 171 | ||
| 172 | if ($query_params['user_query']) |
|
| 173 | $query_where[] = '{raw:user_query}'; |
|
| @@ 187-191 (lines=5) @@ | ||
| 184 | ||
| 185 | $count = 0; |
|
| 186 | if (empty($modSettings['search_simple_fulltext'])) |
|
| 187 | foreach ($words['words'] as $regularWord) |
|
| 188 | { |
|
| 189 | $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 . '}'; |
|
| 190 | $query_params['complex_body_' . $count++] = empty($modSettings['search_match_words']) || $search_data['no_regexp'] ? '%' . strtr($regularWord, array('_' => '\\_', '%' => '\\%')) . '%' : '[[:<:]]' . addcslashes(preg_replace(array('/([\[\]$.+*?|{}()])/'), array('[$1]'), $regularWord), '\\\'') . '[[:>:]]'; |
|
| 191 | } |
|
| 192 | ||
| 193 | if ($query_params['user_query']) |
|
| 194 | $query_where[] = '{raw:user_query}'; |
|