From 02378e94e779bbd407ef86166884c00e32d152fc Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Fri, 28 Mar 2014 21:58:18 +0100 Subject: [PATCH 01/13] [ticket/10423] Remove * from search or highlight string PHPBB3-10423 --- phpBB/search.php | 9 +++++---- phpBB/viewtopic.php | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/phpBB/search.php b/phpBB/search.php index 0f13dbbfa0..43eb42514e 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -574,9 +574,9 @@ if ($keywords || $author || $author_id || $search_id || $submit) } // define some vars for urls - $hilit = implode('|', explode(' ', preg_replace('#\s+#u', ' ', str_replace(array('+', '-', '|', '(', ')', '"'), ' ', $keywords)))); - // Do not allow *only* wildcard being used for hilight - $hilit = (strspn($hilit, '*') === strlen($hilit)) ? '' : $hilit; + // A single wildcard will destroy the search query + $hilit = trim(preg_replace('#(?<=^|\s)\*(?=\s|$)#', '', str_replace(array('+', '-', '|', '(', ')', '"'), ' ', $keywords))); + $hilit = implode('|', explode(' ', preg_replace('#\s+#u', ' ', $hilit))); $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit))); $u_show_results = '&sr=' . $show_results; @@ -840,7 +840,8 @@ if ($keywords || $author || $author_id || $search_id || $submit) $hilit_array = array_filter(explode('|', $hilit), 'strlen'); foreach ($hilit_array as $key => $value) { - $hilit_array[$key] = str_replace('\*', '\w*?', preg_quote($value, '#')); + $hilit_array[$key] = preg_replace('#\s+#u', ' ', trim(preg_replace('#(?<=^|\s)\*(?=\s|$)#', '', $value))); + $hilit_array[$key] = str_replace('\*', '\w*?', preg_quote($hilit_array[$key], '#')); $hilit_array[$key] = preg_replace('#(^|\s)\\\\w\*\?(\s|$)#', '$1\w+?$2', $hilit_array[$key]); } $hilit = implode('|', $hilit_array); diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index e08d6e1ef5..4c9302dbbe 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -475,9 +475,10 @@ if ($hilit_words) { if (trim($word)) { + $word = preg_replace('#\s+#u', ' ', trim(preg_replace('#(?<=^|\s)\*(?=\s|$)#', '', $word))); $word = str_replace('\*', '\w+?', preg_quote($word, '#')); $word = preg_replace('#(^|\s)\\\\w\*\?(\s|$)#', '$1\w+?$2', $word); - $highlight_match .= (($highlight_match != '') ? '|' : '') . $word; + $highlight_match .= (($highlight_match != '' && $word != '') ? '|' : '') . $word; } } From d3f378d1d62acb000d822a50a1695110ebe731ab Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 11 Apr 2014 09:08:46 +0200 Subject: [PATCH 02/13] [ticket/12388] Fix translation of log entries without additional log data PHPBB3-12388 --- phpBB/phpbb/log/log.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php index 24eb408b63..44fba06d9d 100644 --- a/phpBB/phpbb/log/log.php +++ b/phpBB/phpbb/log/log.php @@ -558,6 +558,10 @@ class log implements \phpbb\log\log_interface $log[$i]['action'] = make_clickable($log[$i]['action']); */ } + else + { + $log[$i]['action'] = $this->user->lang($log[$i]['action']); + } $i++; } From 68bd70ef376cc3c6a5ac89e5c29f33df9247df9d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 11 Apr 2014 13:09:16 +0200 Subject: [PATCH 03/13] [ticket/12388] Add tests for lang() use on log actions without data PHPBB3-12388 --- tests/log/function_view_log_test.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/log/function_view_log_test.php b/tests/log/function_view_log_test.php index 9148d23bb4..2ddf7522f4 100644 --- a/tests/log/function_view_log_test.php +++ b/tests/log/function_view_log_test.php @@ -164,7 +164,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'topic_id' => 45, 'viewforum' => '', - 'action' => '{LOG MOD2}', + 'action' => 'LOG_MOD2', 'viewtopic' => '', 'viewlogs' => '', ), @@ -185,7 +185,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'topic_id' => 0, 'viewforum' => '', - 'action' => '{LOG USER}
admin', + 'action' => 'LOG_USER admin', ), 9 => array( 'id' => 9, @@ -204,7 +204,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'topic_id' => 0, 'viewforum' => '', - 'action' => '{LOG USER}
guest', + 'action' => 'LOG_USER guest', ), ); @@ -331,6 +331,8 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case // Test sprintf() of the data into the action $user->lang = array( 'LOG_INSTALL_INSTALLED' => 'installed: %s', + 'LOG_USER' => 'User
%s', + 'LOG_MOD2' => 'Mod2', ); $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE); From e6a4633b514b0f7dbb3172dc29784c4b19a6d710 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 13 Apr 2014 19:48:49 +0800 Subject: [PATCH 04/13] [ticket/12400] Add viewforum event to modify topics data The event allows extensions to use and/or modify topics list and/or topics data before dumping out the viewforum page. For extensions which operate with viewforum page, f.e. if the topics list and data is needed to retrieve, add, modify additional topics info before the output loop. PHPBB3-12400 --- phpBB/viewforum.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 4da0267284..a7396f9c72 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -653,6 +653,18 @@ $template->assign_vars(array( $topic_list = ($store_reverse) ? array_merge($announcement_list, array_reverse($topic_list)) : array_merge($announcement_list, $topic_list); $topic_tracking_info = $tracking_topics = array(); +/** +* Modify topics data before we display the viewforum page +* +* @event core.viewforum_modify_topics_data +* @var array topic_list Array with current viewforum page topic ids +* @var array rowset Array with topics data (in topic_id => topic_data format) +* @var int total_topic_count Forum's total topic count +* @since 3.1.0-b3 +*/ +$vars = array('topic_list', 'rowset', 'total_topic_count'); +extract($phpbb_dispatcher->trigger_event('core.viewforum_modify_topics_data', compact($vars))); + // Okay, lets dump out the page ... if (sizeof($topic_list)) { From 62a729e85efe92bd268c691b6b73bdf379d8fb8e Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 13 Apr 2014 20:54:15 +0800 Subject: [PATCH 05/13] [ticket/12401] Pass more data to core.viewtopic_modify_post_row event $topic_data array is used in viewtopic.php to populate $post_row template block array data. Although $topic_data is not being passed to core.viewtopic_modify_post_row event for modifying/adding $post_row data in it. So, pass this array to the event. Also, total_posts is added. PHPBB3-12401 --- phpBB/viewtopic.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 1a74ad3e38..885a706331 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1674,15 +1674,18 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * @var int start Start item of this page * @var int current_row_number Number of the post on this page * @var int end Number of posts on this page + * @var int total_posts Total posts count * @var array row Array with original post and user data * @var array cp_row Custom profile field data of the poster * @var array attachments List of attachments * @var array user_poster_data Poster's data from user cache * @var array post_row Template block array of the post + * @var array topic_data Array with topic data * @since 3.1-A1 * @change 3.1.0-a3 Added vars start, current_row_number, end, attachments + * @change 3.1.0-b3 Added topic_data array, total_posts */ - $vars = array('start', 'current_row_number', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row'); + $vars = array('start', 'current_row_number', 'end', 'total_posts', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row', 'topic_data'); extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_row', compact($vars))); $i = $current_row_number; From face175471b5064117ca57ece53a3403e51e20ba Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sun, 13 Apr 2014 21:15:14 +0200 Subject: [PATCH 06/13] [ticket/10423] Move code into a function and add tests for it PHPBB3-10423 --- phpBB/includes/functions_content.php | 18 +++++++++ phpBB/search.php | 8 ++-- phpBB/viewtopic.php | 2 +- .../phpbb_clean_search_string_test.php | 37 +++++++++++++++++++ 4 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 tests/functions_content/phpbb_clean_search_string_test.php diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 6213d2fd24..69a29dc31b 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -21,6 +21,7 @@ if (!defined('IN_PHPBB')) * make_jumpbox() * bump_topic_allowed() * get_context() +* phpbb_clean_search_string() * decode_message() * strip_bbcode() * generate_text_for_display() @@ -360,6 +361,23 @@ function get_context($text, $words, $length = 400) } } +/** +* Cleans a search string by removing single wildcards from it and replacing multiple spaces with a single one. +* +* @param string $search_string The full search string which should be cleaned. +* +* @return string The cleaned search string without any wildcards and multiple spaces. +*/ +function phpbb_clean_search_string($search_string) +{ + // This regular expressions matches every single wildcard. + // That means one after a whitespace or the beginning of the string or one before a whitespace or the end of the string. + $search_string = preg_replace('#(?<=^|\s)\*(?=\s|$)#', '', $search_string); + $search_string = trim($search_string); + $search_string = preg_replace('#\s+#u', ' ', $search_string); + return $search_string; +} + /** * Decode text whereby text is coming from the db and expected to be pre-parsed content * We are placing this outside of the message parser because we are often in need of it... diff --git a/phpBB/search.php b/phpBB/search.php index 43eb42514e..d0d86fac17 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -574,9 +574,9 @@ if ($keywords || $author || $author_id || $search_id || $submit) } // define some vars for urls - // A single wildcard will destroy the search query - $hilit = trim(preg_replace('#(?<=^|\s)\*(?=\s|$)#', '', str_replace(array('+', '-', '|', '(', ')', '"'), ' ', $keywords))); - $hilit = implode('|', explode(' ', preg_replace('#\s+#u', ' ', $hilit))); + // A single wildcard will make the search results look ugly + $hilit = phpbb_clean_search_string(str_replace(array('+', '-', '|', '(', ')', '"'), ' ', $keywords)); + $hilit = str_replace(' ', '|', $hilit); $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit))); $u_show_results = '&sr=' . $show_results; @@ -840,7 +840,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $hilit_array = array_filter(explode('|', $hilit), 'strlen'); foreach ($hilit_array as $key => $value) { - $hilit_array[$key] = preg_replace('#\s+#u', ' ', trim(preg_replace('#(?<=^|\s)\*(?=\s|$)#', '', $value))); + $hilit_array[$key] = phpbb_clean_search_string($value); $hilit_array[$key] = str_replace('\*', '\w*?', preg_quote($hilit_array[$key], '#')); $hilit_array[$key] = preg_replace('#(^|\s)\\\\w\*\?(\s|$)#', '$1\w+?$2', $hilit_array[$key]); } diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 4c9302dbbe..31bc1d2701 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -475,7 +475,7 @@ if ($hilit_words) { if (trim($word)) { - $word = preg_replace('#\s+#u', ' ', trim(preg_replace('#(?<=^|\s)\*(?=\s|$)#', '', $word))); + $word = phpbb_clean_search_string($word); $word = str_replace('\*', '\w+?', preg_quote($word, '#')); $word = preg_replace('#(^|\s)\\\\w\*\?(\s|$)#', '$1\w+?$2', $word); $highlight_match .= (($highlight_match != '' && $word != '') ? '|' : '') . $word; diff --git a/tests/functions_content/phpbb_clean_search_string_test.php b/tests/functions_content/phpbb_clean_search_string_test.php new file mode 100644 index 0000000000..3706ffedf9 --- /dev/null +++ b/tests/functions_content/phpbb_clean_search_string_test.php @@ -0,0 +1,37 @@ +assertEquals($expected, phpbb_clean_search_string($search_string)); + } +} From dde7ac3b2bcee9832a12255a8df496a67743e2e0 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sun, 13 Apr 2014 21:31:44 +0200 Subject: [PATCH 07/13] [ticket/10423] Match multiple wildcards Multiple wildcards are removed from the string if there is no word before or after them. If there is a word before or after them, they are just replaced with a single one. PHPBB3-10423 --- phpBB/includes/functions_content.php | 4 ++-- tests/functions_content/phpbb_clean_search_string_test.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 69a29dc31b..19459239d5 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -372,9 +372,9 @@ function phpbb_clean_search_string($search_string) { // This regular expressions matches every single wildcard. // That means one after a whitespace or the beginning of the string or one before a whitespace or the end of the string. - $search_string = preg_replace('#(?<=^|\s)\*(?=\s|$)#', '', $search_string); + $search_string = preg_replace('#(?<=^|\s)\*+(?=\s|$)#', '', $search_string); $search_string = trim($search_string); - $search_string = preg_replace('#\s+#u', ' ', $search_string); + $search_string = preg_replace(array('#\s+#u', '#\*+#u'), array(' ', '*'), $search_string); return $search_string; } diff --git a/tests/functions_content/phpbb_clean_search_string_test.php b/tests/functions_content/phpbb_clean_search_string_test.php index 3706ffedf9..fef9b5e9ea 100644 --- a/tests/functions_content/phpbb_clean_search_string_test.php +++ b/tests/functions_content/phpbb_clean_search_string_test.php @@ -24,6 +24,8 @@ class phpbb_functions_content_phpbb_clean_search_string_test extends phpbb_test_ array('* *test*', '*test*'), array('test test * test', 'test test test'), array(' some wild*cards * between wo*rds ', 'some wild*cards between wo*rds'), + array(' we * now have*** multiple wild***cards * ', 'we now have* multiple wild*cards'), + array('pi is *** . * **** * *****', 'pi is .'), ); } From 6584f5eba68e99ab05ff4abebbcddd2a51b6d8dc Mon Sep 17 00:00:00 2001 From: n-aleha Date: Sun, 13 Apr 2014 23:29:54 +0300 Subject: [PATCH 08/13] [ticket/12191] Move notification options to bottom while installing Move "ucp>board preferences>edit notification options" to bottom while installing. PHPBB3-12191 --- phpBB/install/install_install.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index c749b54f40..db8156a831 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1662,6 +1662,18 @@ class install_install extends module $db->sql_freeresult($result); $_module->move_module_by($row, 'move_down', 4); + + // Move notification options module 4 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'ucp_notifications' + AND module_class = 'ucp' + AND module_mode = 'notification_options'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_down', 4); } // And now for the special ones From 11c4d14a9bf2fec0fbf9226cd1d7cb3a1468ac26 Mon Sep 17 00:00:00 2001 From: n-aleha Date: Mon, 14 Apr 2014 08:37:47 +0300 Subject: [PATCH 09/13] [ticket/12391] Assign variables to core.posting_modify_template_vars Assign variables to event "core.posting_modify_template_vars". Also, fix a couple of typos. PHPBB3-12391 --- phpBB/posting.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/phpBB/posting.php b/phpBB/posting.php index f592402fc6..ed1268e84b 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -52,7 +52,7 @@ $current_time = time(); /** * This event allows you to alter the above parameters, such as submit and mode -* +* * Note: $refresh must be true to retain previously submitted form data. * * Note: The template class will not work properly until $user->setup() is @@ -74,7 +74,7 @@ $current_time = time(); * viewtopic or viewforum depending on if the user * is posting a new topic or editing a post) * @var bool refresh Whether or not to retain previously submitted data -* @var string mode What action to take if the form has been sumitted +* @var string mode What action to take if the form has been submitted * post|reply|quote|edit|delete|bump|smilies|popup * @var array error Any error strings; a non-empty array aborts * form submission. @@ -1548,9 +1548,21 @@ $template->assign_vars(array( * This event allows you to modify template variables for the posting screen * * @event core.posting_modify_template_vars +* @var array post_data Array with post data +* @var array moderators Array with forum moderators +* @var string mode What action to take if the form is submitted +* post|reply|quote|edit|delete|bump|smilies|popup +* @var string page_title Title of the mode page +* @var bool s_topic_icons Whether or not to show the topic icons +* @var string form_enctype If attachments are allowed for this form the value of +* this is "multipart/form-data" else it is the empty string +* @var string s_action The URL to submit the POST data to +* @var string s_hidden_fields The concatenated input tags of the form's hidden fields * @since 3.1-A1 +* @change 3.1.0-b3 Added vars post_data, moderators, mode, page_title, s_topic_icons, form_enctype, s_action, s_hidden_fields */ -$phpbb_dispatcher->dispatch('core.posting_modify_template_vars'); +$vars = array('post_data', 'moderators', 'mode', 'page_title', 's_topic_icons', 'form_enctype', 's_action', 's_hidden_fields'); +extract($phpbb_dispatcher->trigger_event('core.posting_modify_template_vars', compact($vars))); // Build custom bbcodes array display_custom_bbcodes(); From 601ecd3da132c376be2119ef7bc7126f219859f3 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Mon, 14 Apr 2014 18:31:30 +0200 Subject: [PATCH 10/13] [ticket/10423] Remove unnecessary include in test PHPBB3-10423 --- tests/functions_content/phpbb_clean_search_string_test.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/functions_content/phpbb_clean_search_string_test.php b/tests/functions_content/phpbb_clean_search_string_test.php index fef9b5e9ea..de642c9040 100644 --- a/tests/functions_content/phpbb_clean_search_string_test.php +++ b/tests/functions_content/phpbb_clean_search_string_test.php @@ -7,7 +7,6 @@ * */ -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php'; class phpbb_functions_content_phpbb_clean_search_string_test extends phpbb_test_case From f3cd7f73e1ed3acbf1a319331e2f99ea27d5fe2d Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Mon, 14 Apr 2014 19:22:14 +0200 Subject: [PATCH 11/13] [ticket/10423] Replace foreach with function in viewtopic.php PHPBB3-10423 --- phpBB/viewtopic.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 31bc1d2701..f52e04e1a8 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -471,18 +471,11 @@ else $highlight_match = $highlight = ''; if ($hilit_words) { - foreach (explode(' ', trim($hilit_words)) as $word) - { - if (trim($word)) - { - $word = phpbb_clean_search_string($word); - $word = str_replace('\*', '\w+?', preg_quote($word, '#')); - $word = preg_replace('#(^|\s)\\\\w\*\?(\s|$)#', '$1\w+?$2', $word); - $highlight_match .= (($highlight_match != '' && $word != '') ? '|' : '') . $word; - } - } - - $highlight = urlencode($hilit_words); + $highlight_match = phpbb_clean_search_string($hilit_words); + $highlight = urlencode($highlight_match); + $highlight_match = str_replace('\*', '\w+?', preg_quote($highlight_match, '#')); + $highlight_match = preg_replace('#(?<=^|\s)\\\\w\*\?(?=\s|$)#', '\w+?', $highlight_match); + $highlight_match = str_replace(' ', '|', $highlight_match); } // Make sure $start is set to the last page if it exceeds the amount From 84c8c61eb2aa9b18b3dc4783e82ac7cf3d891046 Mon Sep 17 00:00:00 2001 From: lucifer4o Date: Thu, 3 Apr 2014 05:41:26 +0300 Subject: [PATCH 12/13] [ticket/12344] Add core.pm_submit_before to function submit_pm PHPBB3-12344 --- phpBB/includes/functions_privmsgs.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 17d67b4a23..9b44984dfa 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1575,7 +1575,7 @@ function get_folder_status($folder_id, $folder) */ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) { - global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path, $phpbb_container; + global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher; // We do not handle erasing pms here if ($mode == 'delete') @@ -1585,6 +1585,18 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) $current_time = time(); + /** + * Get all parts of the PM that are to be submited to the DB. + * + * @event core.submit_pm_before + * @var string mode PM Post mode - post|reply|quote|quotepost|forward|edit + * @var string subject Subject of the private message + * @var array data The whole row data of the PM. + * @since 3.1.0-b3 + */ + $vars = array('mode', 'subject', 'data'); + extract($phpbb_dispatcher->trigger_event('core.submit_pm_before', compact($vars))); + // Collect some basic information about which tables and which rows to update/insert $sql_data = array(); $root_level = 0; From bff63be512a0289d8d3278fe7510617be8b65cf4 Mon Sep 17 00:00:00 2001 From: n-aleha Date: Mon, 14 Apr 2014 17:36:13 +0300 Subject: [PATCH 13/13] [ticket/12397] Fix sql_unique_index_exists doc block db_tools::sql_unique_index_exists() searches for unique indexes but not primary key indexes. PHPBB3-12397 --- phpBB/includes/db/db_tools.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php index 8dce769395..6913960185 100644 --- a/phpBB/includes/db/db_tools.php +++ b/phpBB/includes/db/db_tools.php @@ -875,7 +875,7 @@ class phpbb_db_tools } } - // Add unqiue indexes? + // Add unique indexes? if (!empty($schema_changes['add_unique_index'])) { foreach ($schema_changes['add_unique_index'] as $table => $index_array) @@ -1286,7 +1286,7 @@ class phpbb_db_tools } /** - * Check if a specified index exists in table. Does not return PRIMARY KEY and UNIQUE indexes. + * Check if a specified index exists in table. Does not return PRIMARY KEY indexes. * * @param string $table_name Table to check the index at * @param string $index_name The index name to check