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
This commit is contained in:
David M 2006-08-07 18:43:30 +00:00
parent 46d7df8772
commit 285ffad3c1
3 changed files with 30 additions and 0 deletions

View file

@ -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

View file

@ -331,6 +331,16 @@ class dbal_mysql4 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

View file

@ -311,6 +311,16 @@ class dbal_mysqli extends dbal
return @mysqli_real_escape_string($this->db_connect_id, $msg);
}
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