Line 393 | Line 393 |
---|
$word = substr($word, 1);
// a group of which at least one may not be in the resulting posts
|
$word = substr($word, 1);
// a group of which at least one may not be in the resulting posts
|
if ($word[0] == '(')
| if (isset($word[0]) && $word[0] == '(')
|
{ $word = array_unique(explode('|', substr($word, 1, -1))); $mode = 'must_exclude_one';
| { $word = array_unique(explode('|', substr($word, 1, -1))); $mode = 'must_exclude_one';
|
Line 634 | Line 634 |
---|
$w_num = 0;
$sql_array = array(
|
$w_num = 0;
$sql_array = array(
|
'SELECT' => ($type == 'posts') ? 'p.post_id' : 'p.topic_id',
| 'SELECT' => ($type == 'posts') ? 'DISTINCT p.post_id' : 'DISTINCT p.topic_id',
|
'FROM' => array( SEARCH_WORDMATCH_TABLE => array(), SEARCH_WORDLIST_TABLE => array(),
| 'FROM' => array( SEARCH_WORDMATCH_TABLE => array(), SEARCH_WORDLIST_TABLE => array(),
|
Line 984 | Line 984 |
---|
// If using mysql and the total result count is not calculated yet, get it from the db if (!$total_results && $is_mysql) {
|
// If using mysql and the total result count is not calculated yet, get it from the db if (!$total_results && $is_mysql) {
|
$sql_count = str_replace("SELECT {$sql_array['SELECT']}", "SELECT COUNT(DISTINCT {$sql_array['SELECT']}) as total_results", $sql);
| $sql_count = str_replace("SELECT {$sql_array['SELECT']}", "SELECT COUNT({$sql_array['SELECT']}) as total_results", $sql);
|
$result = $this->db->sql_query($sql_count);
|
$result = $this->db->sql_query($sql_count);
|
$total_results = (int) $this->db->sql_fetchfield('total_results');
| $total_results = $sql_array['GROUP_BY'] ? count($this->db->sql_fetchrowset($result)) : $this->db->sql_fetchfield('total_results');
|
$this->db->sql_freeresult($result);
if (!$total_results)
| $this->db->sql_freeresult($result);
if (!$total_results)
|
Line 1824 | Line 1824 |
---|
/** * Replace HTML entities and NCRs */
|
/** * Replace HTML entities and NCRs */
|
$text = htmlspecialchars_decode(utf8_decode_ncr($text), ENT_QUOTES);
| $text = html_entity_decode(utf8_decode_ncr($text), ENT_QUOTES);
|
/** * Normalize to NFC
| /** * Normalize to NFC
|