summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorPhil Sturgeon <me@philsturgeon.com>2021-11-17 17:29:32 +0100
committerPhil Sturgeon <me@philsturgeon.com>2021-11-17 17:29:32 +0100
commit47c6b45f524f826e56aff8e77bf289bcbfa1b51d (patch)
treee2533dc0e74d62480b52550a13385168aa9f1992 /system
parentd49ffb0cbbb19b552bf8f33cbfe9e52505eae21e (diff)
parent5ad670dea78cc0f0c0fd690220a243a905cb06bf (diff)
Merge branch 'php80-patch1' of https://github.com/sapics/CodeIgniter into ci3-php8
Diffstat (limited to 'system')
-rw-r--r--system/core/Output.php1
-rw-r--r--system/database/DB_driver.php2
-rw-r--r--system/database/drivers/pdo/pdo_driver.php8
3 files changed, 9 insertions, 2 deletions
diff --git a/system/core/Output.php b/system/core/Output.php
index a2397763d..bbad9f168 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -305,7 +305,6 @@ class CI_Output {
return array_shift($headers);
}, $this->headers);
- // Combine headers already sent with our batched headers
$headers = array_merge(
$header_lines,
headers_list()
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index cba96d9a2..a213d5cba 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -825,7 +825,7 @@ abstract class CI_DB_driver {
{
return $this->_trans_status;
}
-
+
// --------------------------------------------------------------------
/**
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index d0a2bf959..b2178b684 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -131,6 +131,14 @@ class CI_DB_pdo_driver extends CI_DB {
$this->options[PDO::ATTR_PERSISTENT] = TRUE;
}
+ // From PHP8.0, default PDO::ATTR_ERRMODE is changed
+ // from PDO::ERRMODE_SILENT to PDO::ERRMODE_EXCEPTION
+ // as https://wiki.php.net/rfc/pdo_default_errmode
+ if ( ! isset($this->options[PDO::ATTR_ERRMODE]))
+ {
+ $this->options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT;
+ }
+
try
{
return new PDO($this->dsn, $this->username, $this->password, $this->options);