diff --git a/phpBB/adm/style/acp_ban.html b/phpBB/adm/style/acp_ban.html
index abc115330c..cbafa554b1 100644
--- a/phpBB/adm/style/acp_ban.html
+++ b/phpBB/adm/style/acp_ban.html
@@ -60,11 +60,11 @@
-
+
-
+
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index d4821d0d5d..5bcda458bf 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -886,8 +886,8 @@ function get_schema_struct()
'ban_start' => array('TIMESTAMP', 0),
'ban_end' => array('TIMESTAMP', 0),
'ban_exclude' => array('BOOL', 0),
- 'ban_reason' => array('STEXT', ''),
- 'ban_give_reason' => array('STEXT', ''),
+ 'ban_reason' => array('VCHAR_UNI', ''),
+ 'ban_give_reason' => array('VCHAR_UNI', ''),
),
'PRIMARY_KEY' => 'ban_id',
'KEYS' => array(
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 336e58b885..4f52a4358d 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -216,7 +216,7 @@ p a {
[Fix] Minor language and style fixes (Bugs #12235, #12493, #11949)
[Feature] Added backlinks to mcp_report (Bug #12905)
[Fix] Only check usernames in guest posts upon edit (Bug #11349)
-
+ [Fix] Added proper unicode support to ban reasons (Bug #12947)
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index f4ec7bb566..352c88f0d6 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -332,6 +332,16 @@ $database_update_info = array(
),
),
),
+ // Changes from 3.0.RC2 to the next version
+ '3.0.RC2' => array(
+ // Remove the following keys
+ 'change_columns' => array(
+ BANLIST_TABLE => array(
+ 'ban_reason' => array('VCHAR_UNI', ''),
+ 'ban_give_reason' => array('VCHAR_UNI', ''),
+ ),
+ ),
+ ),
);
// Determine mapping database type
@@ -1406,7 +1416,16 @@ function sql_column_change($dbms, $table_name, $column_name, $column_data)
break;
case 'postgres':
- $sql = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET ' . $column_data['column_type_sql'];
+ $default_pos = strpos($column_data['column_type_sql'], ' DEFAULT');
+
+ if ($default_pos === false)
+ {
+ $sql = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' TYPE ' . $column_data['column_type_sql'];
+ }
+ else
+ {
+ $sql = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' TYPE ' . substr($column_data['column_type_sql'], 0, $default_pos) . ', ALTER COLUMN ' . $column_name . ' SET ' . substr($column_data['column_type_sql'], $default_pos + 1);
+ }
_sql($sql, $errored, $error_ary);
break;
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index f1c74512eb..d0f9cf88d1 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -136,8 +136,8 @@ CREATE TABLE phpbb_banlist (
ban_start INTEGER DEFAULT 0 NOT NULL,
ban_end INTEGER DEFAULT 0 NOT NULL,
ban_exclude INTEGER DEFAULT 0 NOT NULL,
- ban_reason BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL,
- ban_give_reason BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL
+ ban_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
+ ban_give_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE
);;
ALTER TABLE phpbb_banlist ADD PRIMARY KEY (ban_id);;
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index 6c2e2ee24d..7dd9c4e924 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -178,8 +178,8 @@ CREATE TABLE [phpbb_banlist] (
[ban_start] [int] DEFAULT (0) NOT NULL ,
[ban_end] [int] DEFAULT (0) NOT NULL ,
[ban_exclude] [int] DEFAULT (0) NOT NULL ,
- [ban_reason] [varchar] (3000) DEFAULT ('') NOT NULL ,
- [ban_give_reason] [varchar] (3000) DEFAULT ('') NOT NULL
+ [ban_reason] [varchar] (255) DEFAULT ('') NOT NULL ,
+ [ban_give_reason] [varchar] (255) DEFAULT ('') NOT NULL
) ON [PRIMARY]
GO
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index 44b292b7e7..7fee7f696d 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -98,8 +98,8 @@ CREATE TABLE phpbb_banlist (
ban_start int(11) UNSIGNED DEFAULT '0' NOT NULL,
ban_end int(11) UNSIGNED DEFAULT '0' NOT NULL,
ban_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
- ban_reason text NOT NULL,
- ban_give_reason text NOT NULL,
+ ban_reason varchar(255) DEFAULT '' NOT NULL,
+ ban_give_reason varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (ban_id),
KEY ban_end (ban_end),
KEY ban_user (ban_userid, ban_exclude),
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 489c7e7bc5..69889a3db2 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -220,8 +220,8 @@ CREATE TABLE phpbb_banlist (
ban_start number(11) DEFAULT '0' NOT NULL,
ban_end number(11) DEFAULT '0' NOT NULL,
ban_exclude number(1) DEFAULT '0' NOT NULL,
- ban_reason varchar2(3000) DEFAULT '' ,
- ban_give_reason varchar2(3000) DEFAULT '' ,
+ ban_reason varchar2(765) DEFAULT '' ,
+ ban_give_reason varchar2(765) DEFAULT '' ,
CONSTRAINT pk_phpbb_banlist PRIMARY KEY (ban_id)
)
/
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index b1ff1d1d11..c49423bcf9 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -199,8 +199,8 @@ CREATE TABLE phpbb_banlist (
ban_start INT4 DEFAULT '0' NOT NULL CHECK (ban_start >= 0),
ban_end INT4 DEFAULT '0' NOT NULL CHECK (ban_end >= 0),
ban_exclude INT2 DEFAULT '0' NOT NULL CHECK (ban_exclude >= 0),
- ban_reason varchar(3000) DEFAULT '' NOT NULL,
- ban_give_reason varchar(3000) DEFAULT '' NOT NULL,
+ ban_reason varchar(255) DEFAULT '' NOT NULL,
+ ban_give_reason varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (ban_id)
);
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index 70b4f8de22..156e4bfc76 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -97,8 +97,8 @@ CREATE TABLE phpbb_banlist (
ban_start INTEGER UNSIGNED NOT NULL DEFAULT '0',
ban_end INTEGER UNSIGNED NOT NULL DEFAULT '0',
ban_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0',
- ban_reason text(65535) NOT NULL DEFAULT '',
- ban_give_reason text(65535) NOT NULL DEFAULT ''
+ ban_reason varchar(255) NOT NULL DEFAULT '',
+ ban_give_reason varchar(255) NOT NULL DEFAULT ''
);
CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end);
diff --git a/phpBB/styles/prosilver/template/mcp_ban.html b/phpBB/styles/prosilver/template/mcp_ban.html
index cc41ce9c1f..531a90bb42 100644
--- a/phpBB/styles/prosilver/template/mcp_ban.html
+++ b/phpBB/styles/prosilver/template/mcp_ban.html
@@ -54,11 +54,11 @@
-
+
-
+
diff --git a/phpBB/styles/subsilver2/template/mcp_ban.html b/phpBB/styles/subsilver2/template/mcp_ban.html
index 7441e4e71c..389f71c6fc 100644
--- a/phpBB/styles/subsilver2/template/mcp_ban.html
+++ b/phpBB/styles/subsilver2/template/mcp_ban.html
@@ -57,11 +57,11 @@
{L_BAN_REASON}: |
- |
+ |
{L_BAN_GIVE_REASON}: |
- |
+ |
|