mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-03-22 13:10:41 +08:00
Merge pull request #920 from PrivateBin/mysql_ansi_quotes
Avoid SUPER privilege when setting the sql_mode for MariaDB/MySQL, fixes #919
This commit is contained in:
commit
d0142c31cc
|
@ -1,5 +1,7 @@
|
||||||
# PrivateBin version history
|
# PrivateBin version history
|
||||||
|
|
||||||
|
* **1.4.1 (not yet released)**
|
||||||
|
* CHANGED: Avoid `SUPER` privilege for setting the `sql_mode` for MariaDB/MySQL (#919)
|
||||||
* **1.4 (2022-04-09)**
|
* **1.4 (2022-04-09)**
|
||||||
* ADDED: Translations for Corsican, Estonian, Finnish and Lojban
|
* ADDED: Translations for Corsican, Estonian, Finnish and Lojban
|
||||||
* ADDED: new HTTP headers improving security (#765)
|
* ADDED: new HTTP headers improving security (#765)
|
||||||
|
|
|
@ -100,7 +100,7 @@ class Database extends AbstractData
|
||||||
// MySQL uses backticks to quote identifiers by default,
|
// MySQL uses backticks to quote identifiers by default,
|
||||||
// tell it to expect ANSI SQL double quotes
|
// tell it to expect ANSI SQL double quotes
|
||||||
if (self::$_type === 'mysql' && defined('PDO::MYSQL_ATTR_INIT_COMMAND')) {
|
if (self::$_type === 'mysql' && defined('PDO::MYSQL_ATTR_INIT_COMMAND')) {
|
||||||
$options['opt'][PDO::MYSQL_ATTR_INIT_COMMAND] = "SET sql_mode='ANSI_QUOTES'";
|
$options['opt'][PDO::MYSQL_ATTR_INIT_COMMAND] = "SET SESSION sql_mode='ANSI_QUOTES'";
|
||||||
}
|
}
|
||||||
$tableQuery = self::_getTableQuery(self::$_type);
|
$tableQuery = self::_getTableQuery(self::$_type);
|
||||||
self::$_db = new PDO(
|
self::$_db = new PDO(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user