diff options
author | David M <davidmj@users.sourceforge.net> | 2006-08-07 18:43:30 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2006-08-07 18:43:30 +0000 |
commit | 285ffad3c131f658d82308c7116df6dc0ea4e5bf (patch) | |
tree | 47dba391b9ccf18de4fdc2d9b31ae16c5f9e9cae /phpBB/includes/db/mysql.php | |
parent | 46d7df8772adfe272048b4e5faba9fdfff6502e1 (diff) | |
download | forums-285ffad3c131f658d82308c7116df6dc0ea4e5bf.tar forums-285ffad3c131f658d82308c7116df6dc0ea4e5bf.tar.gz forums-285ffad3c131f658d82308c7116df6dc0ea4e5bf.tar.bz2 forums-285ffad3c131f658d82308c7116df6dc0ea4e5bf.tar.xz forums-285ffad3c131f658d82308c7116df6dc0ea4e5bf.zip |
This is kinda nice.. Before MySQL 5.0.3, traling spaces were removed when values were stored. This means that some BBCodes might not have worked. A bad thing. So, I cleverly stick a \0 at the end if this is the case. The \0 does not really modify the bitfield at all, it simply represents that there are no BBCodes in that range of eight. Idealy, we should do a version check to see if this is needed but this is just a nice fix for now...
git-svn-id: file:///svn/phpbb/trunk@6252 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db/mysql.php')
-rw-r--r-- | phpBB/includes/db/mysql.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index 7e363721a9..ee7918473d 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -328,6 +328,16 @@ class dbal_mysql extends dbal return @mysql_real_escape_string($msg, $this->db_connect_id); } + function sql_escape_binary($msg) + { + // If the last char is + if (substr($msg, -1) == ' ') + { + $msg .= "\0"; + } + return "'" . $this->sql_escape($msg) . "'"; + } + /** * Build db-specific query data * @access: private |