aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/phpbb/db/migration/data/v310/style_update_p1.php4
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php3
2 files changed, 5 insertions, 2 deletions
diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php
index dcf031a7a7..3e28e8747d 100644
--- a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php
+++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php
@@ -160,7 +160,7 @@ class style_update_p1 extends \phpbb\db\migration\migration
FROM ' . STYLES_TABLE . "
WHERE style_name = 'prosilver'";
$result = $this->sql_query($sql);
- $default_style = $this->db->sql_fetchfield('style_id');
+ $default_style = (int) $this->db->sql_fetchfield('style_id');
$this->db->sql_freeresult($result);
$this->config->set('default_style', $default_style);
@@ -184,7 +184,7 @@ class style_update_p1 extends \phpbb\db\migration\migration
// Reset styles for users
$this->sql_query('UPDATE ' . USERS_TABLE . "
- SET user_style = '" . $valid_styles[0] . "'
+ SET user_style = '" . (int) $valid_styles[0] . "'
WHERE " . $this->db->sql_in_set('user_style', $valid_styles, true));
}
}
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index eb56049515..c9943c4302 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -572,6 +572,9 @@ class phpbb_functional_test_case extends phpbb_test_case
$config['rand_seed'] = '';
$config['rand_seed_last_update'] = time() + 600;
+ // Prevent new user to have an invalid style
+ $config['default_style'] = 1;
+
// Required by user_add
global $db, $cache, $phpbb_dispatcher, $phpbb_container;
$db = $this->get_db();