diff options
-rw-r--r-- | .travis.yml | 3 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/db/migration/data/v310/timezone.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/search/base.php | 2 | ||||
-rw-r--r-- | phpBB/search.php | 46 |
5 files changed, 51 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml index 7bd7e85ab1..f1f95fc4a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,11 +22,14 @@ matrix: env: DB=mysqli - php: 7.0 env: DB=mysqli + - php: 7.1 + env: DB=mysqli - php: nightly env: DB=mysqli - php: hhvm env: DB=mysqli allow_failures: + - php: 7.1 - php: hhvm - php: nightly fast_finish: true diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 864be41d8b..da698ae4cb 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -853,7 +853,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ $tracking['tf'][$forum_id][$topic_id36] = true; } - $tracking['t'][$topic_id36] = base_convert($post_time - $config['board_startdate'], 10, 36); + $tracking['t'][$topic_id36] = base_convert($post_time - (int) $config['board_startdate'], 10, 36); // If the cookie grows larger than 10000 characters we will remove the smallest value // This can result in old topics being unread - but most of the time it should be accurate... diff --git a/phpBB/phpbb/db/migration/data/v310/timezone.php b/phpBB/phpbb/db/migration/data/v310/timezone.php index 1f6b47ad50..03a8d1ab34 100644 --- a/phpBB/phpbb/db/migration/data/v310/timezone.php +++ b/phpBB/phpbb/db/migration/data/v310/timezone.php @@ -103,7 +103,7 @@ class timezone extends \phpbb\db\migration\migration */ public function convert_phpbb30_timezone($timezone, $dst) { - $offset = $timezone + $dst; + $offset = (float) $timezone + (int) $dst; switch ($timezone) { diff --git a/phpBB/phpbb/search/base.php b/phpBB/phpbb/search/base.php index d9313dddab..56de973b65 100644 --- a/phpBB/phpbb/search/base.php +++ b/phpBB/phpbb/search/base.php @@ -286,7 +286,7 @@ class base $sql = 'DELETE FROM ' . SEARCH_RESULTS_TABLE . ' - WHERE search_time < ' . (time() - $config['search_store_results']); + WHERE search_time < ' . (time() - (int) $config['search_store_results']); $db->sql_query($sql); } } diff --git a/phpBB/search.php b/phpBB/search.php index fdd4aec7ae..5946e7531e 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -598,6 +598,48 @@ if ($keywords || $author || $author_id || $search_id || $submit) $total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_posts_fid_sql, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page); } + /** + * Event to search otherwise than by keywords or author + * + * @event core.search_backend_search_after + * @var string show_results 'posts' or 'topics' type of ids + * @var string search_fields The data fields to search in + * @var string search_terms Is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words) + * @var array sort_by_sql Array of SQL sorting instructions + * @var string sort_key The sort key + * @var string sort_dir The sort direction + * @var int sort_days Limit the age of results + * @var array ex_fid_ary Array of excluded forum ids + * @var string m_approve_posts_fid_sql Specifies which types of posts the user can view in which forums + * @var int topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched + * @var array author_id_ary Array of exclusive author ids + * @var string sql_author_match Specifies the author match, when ANONYMOUS is also a search-match + * @var array id_ary Array of post or topic ids for search result + * @var int start The starting id of the results + * @var int per_page Number of ids each page is supposed to contain + * @var int total_match_count The total number of search matches + * @since 3.1.10-RC1 + */ + $vars = array( + 'show_results', + 'search_fields', + 'search_terms', + 'sort_by_sql', + 'sort_key', + 'sort_dir', + 'sort_days', + 'ex_fid_ary', + 'm_approve_posts_fid_sql', + 'topic_id', + 'author_id_ary', + 'sql_author_match', + 'id_ary', + 'start', + 'per_page', + 'total_match_count', + ); + extract($phpbb_dispatcher->trigger_event('core.search_backend_search_after', compact($vars))); + $sql_where = ''; if (sizeof($id_ary)) @@ -648,14 +690,16 @@ if ($keywords || $author || $author_id || $search_id || $submit) * @event core.search_modify_url_parameters * @var string u_search Search URL parameters string * @var string search_id Predefined search type name + * @var string show_results String indicating the show results mode * @var string sql_where The SQL WHERE string used by search to get topic data * @var int total_match_count The total number of search matches * @since 3.1.7-RC1 - * @changed 3.1.10-RC1 Added sql_where, total_match_count + * @changed 3.1.10-RC1 Added show_results, sql_where, total_match_count */ $vars = array( 'u_search', 'search_id', + 'show_results', 'sql_where', 'total_match_count', ); |