From bace8dd31f0a5c2f95ae612e7e1b2e6d3083613b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Fri, 8 Sep 2017 15:02:29 +0200 Subject: [PATCH] [ticket/15201] Add casting PHPBB3-15201 --- phpBB/phpbb/db/migration/data/v310/style_update_p1.php | 2 +- phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php | 6 +++--- 2 files changed, 4 insertions(+), 4 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 3e28e8747d..f50ab33830 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php @@ -165,7 +165,7 @@ class style_update_p1 extends \phpbb\db\migration\migration $this->config->set('default_style', $default_style); - $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = ' . $default_style; + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = ' . (int) $default_style; $this->sql_query($sql); } else diff --git a/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php index e0caae812a..282c6bef2f 100644 --- a/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php +++ b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php @@ -43,8 +43,8 @@ class fix_user_styles extends \phpbb\db\migration\migration $this->db->sql_freeresult($result); // Set the default style to users who have an invalid style - $this->sql_query('UPDATE ' . USERS_TABLE . " - SET user_style = $default_style - WHERE " . $this->db->sql_in_set('user_style', $enabled_styles, true)); + $this->sql_query('UPDATE ' . USERS_TABLE . ' + SET user_style = ' . (int) $default_style . ' + WHERE ' . $this->db->sql_in_set('user_style', $enabled_styles, true)); } }