mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-17 13:00:20 +02:00
Merge branch '3.2.x'
This commit is contained in:
commit
6ac85a371a
@ -33,13 +33,17 @@ class fix_user_styles extends \phpbb\db\migration\migration
|
|||||||
public function styles_fix()
|
public function styles_fix()
|
||||||
{
|
{
|
||||||
$default_style = (int) $this->config['default_style'];
|
$default_style = (int) $this->config['default_style'];
|
||||||
|
$enabled_styles = array();
|
||||||
|
|
||||||
// Get enabled styles
|
// Get enabled styles
|
||||||
$sql = 'SELECT style_id
|
$sql = 'SELECT style_id
|
||||||
FROM ' . STYLES_TABLE . '
|
FROM ' . STYLES_TABLE . '
|
||||||
WHERE style_active = 1';
|
WHERE style_active = 1';
|
||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
$enabled_styles = $result->fetch_array();
|
while ($row = $this->db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$enabled_styles[] = (int) $row['style_id'];
|
||||||
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
// Set the default style to users who have an invalid style
|
// Set the default style to users who have an invalid style
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
namespace phpbb\db\migration\data\v32x;
|
namespace phpbb\db\migration\data\v32x;
|
||||||
|
|
||||||
class merge_duplicate_bbcodes extends \phpbb\db\migration\migration
|
class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migration
|
||||||
{
|
{
|
||||||
public function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
@ -30,7 +30,7 @@ class merge_duplicate_bbcodes extends \phpbb\db\migration\migration
|
|||||||
while ($row = $this->db->sql_fetchrow($result))
|
while ($row = $this->db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$variant = (substr($row['bbcode_tag'], -1) === '=') ? 'with': 'without';
|
$variant = (substr($row['bbcode_tag'], -1) === '=') ? 'with': 'without';
|
||||||
$bbcode_name = rtrim($row['bbcode_tag'], '=');
|
$bbcode_name = strtolower(rtrim($row['bbcode_tag'], '='));
|
||||||
$bbcodes[$bbcode_name][$variant] = $row;
|
$bbcodes[$bbcode_name][$variant] = $row;
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user