mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-23 01:51:31 +02:00
[ticket/12711] Cast values to string such that they are quoted in SQL queries.
The value is stored in a text column and the key is stored in a varchar. Some DBMSes do not like it when we insert integers into text columns. Cast both to string to be on the safe side. PHPBB3-12711
This commit is contained in:
@@ -105,8 +105,8 @@ class db_text
|
|||||||
if (!$this->db->sql_affectedrows($result))
|
if (!$this->db->sql_affectedrows($result))
|
||||||
{
|
{
|
||||||
$sql = 'INSERT INTO ' . $this->table . ' ' . $this->db->sql_build_array('INSERT', array(
|
$sql = 'INSERT INTO ' . $this->table . ' ' . $this->db->sql_build_array('INSERT', array(
|
||||||
'config_name' => $key,
|
'config_name' => (string) $key,
|
||||||
'config_value' => $value,
|
'config_value' => (string) $value,
|
||||||
));
|
));
|
||||||
$this->db->sql_query($sql);
|
$this->db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user