From 0048c2b6135049cd4669ff8208331c3870121f5d Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 23 Aug 2016 21:30:10 +0200 Subject: [PATCH 1/3] [ticket/14748] Make sure config values are casted to int PHPBB3-14748 --- phpBB/includes/functions.php | 2 +- phpBB/phpbb/db/migration/data/v310/timezone.php | 2 +- phpBB/phpbb/search/base.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 588a717f0e..5f8519bb41 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..b1a7504c06 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 = (int) $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); } } From 4f8fcaa95b1ccfb8226fec8f3f237e8b94444078 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 24 Aug 2016 21:03:55 +0200 Subject: [PATCH 2/3] [ticket/14748] Add PHP 7.1 to test matrix and keep nightly PHP nightlies already target PHP 7.2. PHPBB3-14748 --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) 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 From 35c62d1e74adc445e65a21f3aa317925bd258893 Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 22 Sep 2016 22:29:18 +0700 Subject: [PATCH 3/3] [ticket/14793] Fix "A non-numeric value encountered" PHP warning on PHP 7.1+ PHPBB3-14793 --- phpBB/includes/functions.php | 2 +- phpBB/phpbb/db/migration/data/v310/timezone.php | 2 +- phpBB/phpbb/search/base.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 465964913c..bec4dbc27a 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); } }