mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
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:
parent
46d7df8772
commit
285ffad3c1
3 changed files with 30 additions and 0 deletions
|
@ -328,6 +328,16 @@ class dbal_mysql extends dbal
|
||||||
return @mysql_real_escape_string($msg, $this->db_connect_id);
|
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
|
* Build db-specific query data
|
||||||
* @access: private
|
* @access: private
|
||||||
|
|
|
@ -331,6 +331,16 @@ class dbal_mysql4 extends dbal
|
||||||
return @mysql_real_escape_string($msg, $this->db_connect_id);
|
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
|
* Build db-specific query data
|
||||||
* @access: private
|
* @access: private
|
||||||
|
|
|
@ -311,6 +311,16 @@ class dbal_mysqli extends dbal
|
||||||
return @mysqli_real_escape_string($this->db_connect_id, $msg);
|
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
|
* Build db-specific query data
|
||||||
* @access: private
|
* @access: private
|
||||||
|
|
Loading…
Add table
Reference in a new issue