diff options
Diffstat (limited to 'phpBB/posting.php')
| -rw-r--r-- | phpBB/posting.php | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index 54427e6e0d..b798f5c119 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1812,11 +1812,28 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u WHERE topic_moved_id = ' . $data['topic_id']); } - // Fulltext parse + // Index message contents if ($update_message && $data['enable_indexing']) { - $search = new fulltext_search(); - $result = $search->add($mode, $data['post_id'], $data['message'], $subject); + // Select the search method and do some additional checks to ensure it can actually be utilised + $search_type = $config['search_type']; + + if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) + { + trigger_error('NO_SUCH_SEARCH_MODULE'); + } + + require("{$phpbb_root_path}includes/search/$search_type.$phpEx"); + + $error = false; + $search = new $search_type($error); + + if ($error) + { + trigger_error($error); + } + + $search->index($mode, $data['post_id'], $data['message'], $subject); } $db->sql_transaction('commit'); |
