aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2007-10-04 04:42:39 +0000
committerDavid M <davidmj@users.sourceforge.net>2007-10-04 04:42:39 +0000
commiteca02ecbf31ce9d33dc12ac9ea59809e1ad1a7bf (patch)
treef64ec2515929f1178f132a84847342fe1ffc4459
parent4f094bdb48379d334a87b65b7c71eacad162a841 (diff)
downloadforums-eca02ecbf31ce9d33dc12ac9ea59809e1ad1a7bf.tar
forums-eca02ecbf31ce9d33dc12ac9ea59809e1ad1a7bf.tar.gz
forums-eca02ecbf31ce9d33dc12ac9ea59809e1ad1a7bf.tar.bz2
forums-eca02ecbf31ce9d33dc12ac9ea59809e1ad1a7bf.tar.xz
forums-eca02ecbf31ce9d33dc12ac9ea59809e1ad1a7bf.zip
#i71
#i72 git-svn-id: file:///svn/phpbb/trunk@8128 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/develop/create_schema_files.php2
-rw-r--r--phpBB/includes/constants.php2
-rw-r--r--phpBB/includes/message_parser.php2
-rw-r--r--phpBB/install/database_update.php6
-rw-r--r--phpBB/install/schemas/firebird_schema.sql2
-rw-r--r--phpBB/install/schemas/mssql_schema.sql2
-rw-r--r--phpBB/install/schemas/mysql_40_schema.sql2
-rw-r--r--phpBB/install/schemas/mysql_41_schema.sql2
-rw-r--r--phpBB/install/schemas/oracle_schema.sql2
-rw-r--r--phpBB/install/schemas/postgres_schema.sql2
-rw-r--r--phpBB/install/schemas/sqlite_schema.sql2
-rw-r--r--phpBB/posting.php2
12 files changed, 17 insertions, 11 deletions
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index 34ac224c9c..c877bd713c 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -1285,7 +1285,7 @@ function get_schema_struct()
'post_checksum' => array('VCHAR:32', ''),
'post_attachment' => array('BOOL', 0),
'bbcode_bitfield' => array('VCHAR:255', ''),
- 'bbcode_uid' => array('VCHAR:5', ''),
+ 'bbcode_uid' => array('VCHAR:8', ''),
'post_postcount' => array('BOOL', 1),
'post_edit_time' => array('TIMESTAMP', 0),
'post_edit_reason' => array('STEXT_UNI', ''),
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index 0823074072..f6622fb43d 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -140,7 +140,7 @@ define('ATTACHMENT_CATEGORY_FLASH', 5); // Flash/SWF files
define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files
// BBCode UID length
-define('BBCODE_UID_LEN', 5);
+define('BBCODE_UID_LEN', 8);
// Number of core BBCodes
define('NUM_CORE_BBCODES', 12);
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 6a066fcd9f..1879f38ab4 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -1006,7 +1006,7 @@ class parse_message extends bbcode_firstpass
function parse_message($message = '')
{
// Init BBCode UID
- $this->bbcode_uid = substr(md5(time()), 0, BBCODE_UID_LEN);
+ $this->bbcode_uid = substr(base_convert(unique_id(), 16, 36), 0, BBCODE_UID_LEN);
if ($message)
{
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index b28879de4d..7a7b5d0840 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -432,6 +432,12 @@ $database_update_info = array(
'user_form_salt' => array('VCHAR_UNI:32', ''),
),
),
+ // Change the following columns
+ 'change_columns' => array(
+ POSTS_TABLE => array(
+ 'bbcode_uid' => array('VCHAR_UNI:8', ''),
+ ),
+ ),
),
);
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index 37e14af4e5..0239279bed 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -629,7 +629,7 @@ CREATE TABLE phpbb_posts (
post_checksum VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
post_attachment INTEGER DEFAULT 0 NOT NULL,
bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
- bbcode_uid VARCHAR(5) CHARACTER SET NONE DEFAULT '' NOT NULL,
+ bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL,
post_postcount INTEGER DEFAULT 1 NOT NULL,
post_edit_time INTEGER DEFAULT 0 NOT NULL,
post_edit_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index 54b3a1fa08..a87d6bb801 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -764,7 +764,7 @@ CREATE TABLE [phpbb_posts] (
[post_checksum] [varchar] (32) DEFAULT ('') NOT NULL ,
[post_attachment] [int] DEFAULT (0) NOT NULL ,
[bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
- [bbcode_uid] [varchar] (5) DEFAULT ('') NOT NULL ,
+ [bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL ,
[post_postcount] [int] DEFAULT (1) NOT NULL ,
[post_edit_time] [int] DEFAULT (0) NOT NULL ,
[post_edit_reason] [varchar] (255) DEFAULT ('') NOT NULL ,
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index 478963e541..0ddca29639 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -441,7 +441,7 @@ CREATE TABLE phpbb_posts (
post_checksum varbinary(32) DEFAULT '' NOT NULL,
post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL,
- bbcode_uid varbinary(5) DEFAULT '' NOT NULL,
+ bbcode_uid varbinary(8) DEFAULT '' NOT NULL,
post_postcount tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
post_edit_reason blob NOT NULL,
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index 88657aa4ac..0686c6cae7 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -441,7 +441,7 @@ CREATE TABLE phpbb_posts (
post_checksum varchar(32) DEFAULT '' NOT NULL,
post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
- bbcode_uid varchar(5) DEFAULT '' NOT NULL,
+ bbcode_uid varchar(8) DEFAULT '' NOT NULL,
post_postcount tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
post_edit_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
post_edit_reason varchar(255) DEFAULT '' NOT NULL,
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index a91f4d07ba..d67fa0a854 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -853,7 +853,7 @@ CREATE TABLE phpbb_posts (
post_checksum varchar2(32) DEFAULT '' ,
post_attachment number(1) DEFAULT '0' NOT NULL,
bbcode_bitfield varchar2(255) DEFAULT '' ,
- bbcode_uid varchar2(5) DEFAULT '' ,
+ bbcode_uid varchar2(8) DEFAULT '' ,
post_postcount number(1) DEFAULT '1' NOT NULL,
post_edit_time number(11) DEFAULT '0' NOT NULL,
post_edit_reason varchar2(765) DEFAULT '' ,
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index 9b439d9fb2..ddf856ed40 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -610,7 +610,7 @@ CREATE TABLE phpbb_posts (
post_checksum varchar(32) DEFAULT '' NOT NULL,
post_attachment INT2 DEFAULT '0' NOT NULL CHECK (post_attachment >= 0),
bbcode_bitfield varchar(255) DEFAULT '' NOT NULL,
- bbcode_uid varchar(5) DEFAULT '' NOT NULL,
+ bbcode_uid varchar(8) DEFAULT '' NOT NULL,
post_postcount INT2 DEFAULT '1' NOT NULL CHECK (post_postcount >= 0),
post_edit_time INT4 DEFAULT '0' NOT NULL CHECK (post_edit_time >= 0),
post_edit_reason varchar(255) DEFAULT '' NOT NULL,
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index f5156144e2..81f9f4bd03 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -428,7 +428,7 @@ CREATE TABLE phpbb_posts (
post_checksum varchar(32) NOT NULL DEFAULT '',
post_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
bbcode_bitfield varchar(255) NOT NULL DEFAULT '',
- bbcode_uid varchar(5) NOT NULL DEFAULT '',
+ bbcode_uid varchar(8) NOT NULL DEFAULT '',
post_postcount INTEGER UNSIGNED NOT NULL DEFAULT '1',
post_edit_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
post_edit_reason text(65535) NOT NULL DEFAULT '',
diff --git a/phpBB/posting.php b/phpBB/posting.php
index fc401b865d..13b9eeb020 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -674,7 +674,7 @@ if ($submit || $preview || $refresh)
$message_md5 = md5($message_parser->message);
// Check checksum ... don't re-parse message if the same
- $update_message = ($mode != 'edit' || $message_md5 != $post_data['post_checksum'] || $status_switch) ? true : false;
+ $update_message = ($mode != 'edit' || $message_md5 != $post_data['post_checksum'] || $status_switch || strlen($post_data['bbcode_uid']) < BBCODE_UID_LEN) ? true : false;
// Parse message
if ($update_message)