From 4ed6f65f94676007b025856bde5ecdf15bf1e757 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 19 Nov 2023 10:41:52 +0100 Subject: [PATCH] Rename DNS option attr_emulate_prepares to emulate_prepares, update changelog [skip ci] --- CHANGELOG.md | 1 + config/defaults.inc.php | 2 +- program/lib/Roundcube/db/mysql.php | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32e9fdbe3..191cf9c7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - Add identities management script - bin/identity.sh (#8887) - Prefer 8bit over quoted-printable for HTML parts, when force_7bit is disabled (#8477) - Convert images in HTML content pasted into HTML editor to `data:` URIs (and later to attachments) (#6938) +- Add possibility to change ATTR_EMULATE_PREPARES via config file (#9213) - ACL: Set default of 'acl_specials' option to ['anyone'] (#8911) - Enigma: Support Kolab's Web Of Anti-Trust feature (#8626) - Managesieve: Support :encodeurl (RFC 5435) (#8917) diff --git a/config/defaults.inc.php b/config/defaults.inc.php index a637448e8..fbd58eeb0 100644 --- a/config/defaults.inc.php +++ b/config/defaults.inc.php @@ -30,7 +30,7 @@ $config = []; // Note: for SQLite use absolute path (Linux): 'sqlite:////full/path/to/sqlite.db?mode=0646' // or (Windows): 'sqlite:///C:/full/path/to/sqlite.db' // Note: Various drivers support various additional arguments for connection, -// for Mysql: key, cipher, cert, capath, ca, verify_server_cert, +// for Mysql: key, cipher, cert, capath, ca, verify_server_cert, emulate_prepares // for Postgres: application_name, sslmode, sslcert, sslkey, sslrootcert, sslcrl, sslcompression, service. // e.g. 'mysql://roundcube:@localhost/roundcubemail?verify_server_cert=false' $config['db_dsnw'] = 'mysql://roundcube:@localhost/roundcubemail'; diff --git a/program/lib/Roundcube/db/mysql.php b/program/lib/Roundcube/db/mysql.php index 001b51051..5f53065c8 100644 --- a/program/lib/Roundcube/db/mysql.php +++ b/program/lib/Roundcube/db/mysql.php @@ -135,7 +135,12 @@ class rcube_db_mysql extends rcube_db $result[PDO::ATTR_AUTOCOMMIT] = true; // Disable emulating of prepared statements - $result[PDO::ATTR_EMULATE_PREPARES] = (isset($dsn['attr_emulate_prepares']) ? rcube_utils::get_boolean($dsn['attr_emulate_prepares']) : false); + if (isset($dsn['emulate_prepares'])) { + $result[PDO::ATTR_EMULATE_PREPARES] = rcube_utils::get_boolean($dsn['emulate_prepares']); + } + else { + $result[PDO::ATTR_EMULATE_PREPARES] = false; + } return $result; }