From 11606c86073db42b0455a654d35d6ff38fb70105 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 9 Feb 2012 21:58:39 +0200 Subject: [PATCH 1/5] [ticket/10637] Leftovers from implementation of extensions Replacing code in includes/functions_admin.php that was missed in ticket 10323 PHPBB3-10637 --- phpBB/includes/functions_admin.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 7fdf874456..7b4393f383 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -847,15 +847,13 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = } // Remove the message from the search index - $search_type = basename($config['search_type']); + $search_type = $config['search_type']; - if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) + if (!class_exists($search_type)) { trigger_error('NO_SUCH_SEARCH_MODULE'); } - include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx"); - $error = false; $search = new $search_type($error); From 1d72a47ea6f47ec95b201ea4a3b9a9e0ea34da9a Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 9 Feb 2012 22:13:13 +0200 Subject: [PATCH 2/5] [ticket/10637] Leftovers from implementation of extensions in mcp_main Replacing code in includes/mcp/mcp_main.php that was missed in ticket 10323 PHPBB3-10637 --- phpBB/includes/mcp/mcp_main.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 10e5956fc2..a21c67924d 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -907,16 +907,11 @@ function mcp_fork_topic($topic_ids) if (!isset($search_type) && $topic_row['enable_indexing']) { // Select the search method and do some additional checks to ensure it can actually be utilised - $search_type = basename($config['search_type']); - - if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) - { - trigger_error('NO_SUCH_SEARCH_MODULE'); - } + $search_type = $config['search_type']; if (!class_exists($search_type)) { - include("{$phpbb_root_path}includes/search/$search_type.$phpEx"); + trigger_error('NO_SUCH_SEARCH_MODULE'); } $error = false; From 92303d2dacdd7be3fad4d2ffba84c0d30fcadeaf Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 9 Feb 2012 22:17:33 +0200 Subject: [PATCH 3/5] [ticket/10637] Leftovers from implementation of extensions in mcp_post Replacing code in includes/mcp/mcp_post.php that was missed in ticket 10323 PHPBB3-10637 --- phpBB/includes/mcp/mcp_post.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index ee79928eb1..2a52a858b3 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -464,12 +464,10 @@ function change_poster(&$post_info, $userdata) } // refresh search cache of this post - $search_type = basename($config['search_type']); + $search_type = $config['search_type']; - if (file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) + if (class_exists($search_type)) { - require("{$phpbb_root_path}includes/search/$search_type.$phpEx"); - // We do some additional checks in the module to ensure it can actually be utilised $error = false; $search = new $search_type($error); From a1a1b61ae8507276f7191be84a8782c0b0218f9c Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 9 Feb 2012 22:22:32 +0200 Subject: [PATCH 4/5] [ticket/10637] Leftovers from implementation of extensions in develop tools Replacing code in development tools that was missed in ticket 10323 PHPBB3-10637 --- phpBB/develop/create_search_index.php | 1 - phpBB/develop/search_fill.php | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php index 28001035f6..1de20f3099 100644 --- a/phpBB/develop/create_search_index.php +++ b/phpBB/develop/create_search_index.php @@ -25,7 +25,6 @@ $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); require($phpbb_root_path . 'common.' . $phpEx); require($phpbb_root_path . 'includes/acp/acp_search.' . $phpEx); -require($phpbb_root_path . 'includes/search/' . $class_name . '.' . $phpEx); $user->session_begin(); $auth->acl($user->data); diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php index 371c8c74cc..4c0b607778 100644 --- a/phpBB/develop/search_fill.php +++ b/phpBB/develop/search_fill.php @@ -34,13 +34,11 @@ $user->setup(); $search_type = $config['search_type']; -if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) +if (!class_exists($search_type)) { trigger_error('NO_SUCH_SEARCH_MODULE'); } -require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx); - $error = false; $search = new $search_type($error); From caeadf85d00ce90b8ea141bcb9a05d229ff1b5b4 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 9 Feb 2012 22:24:46 +0200 Subject: [PATCH 5/5] [ticket/10637] Leftovers from implementation of extensions in convertor Replacing code in convertor that was missed in ticket 10323 PHPBB3-10637 --- phpBB/install/install_convert.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 5a868004ef..db974f9903 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -735,22 +735,20 @@ class install_convert extends module $this->p_master->error(sprintf($user->lang['COULD_NOT_FIND_PATH'], $convert->options['forum_path']), __LINE__, __FILE__); } - $search_type = basename(trim($config['search_type'])); + $search_type = $config['search_type']; // For conversions we are a bit less strict and set to a search backend we know exist... - if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) + if (!class_exists($search_type)) { - $search_type = 'fulltext_native'; + $search_type = 'phpbb_search_fulltext_native'; set_config('search_type', $search_type); } - if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) + if (!class_exists($search_type)) { trigger_error('NO_SUCH_SEARCH_MODULE'); } - require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx); - $error = false; $convert->fulltext_search = new $search_type($error);