diff options
author | sgiehl <stefan@matomo.org> | 2022-05-08 21:38:26 +0300 |
---|---|---|
committer | sgiehl <stefan@matomo.org> | 2022-05-08 23:35:46 +0300 |
commit | 32b78c514777b618fcd14bcb558bee9dc2dfb95e (patch) | |
tree | bb0adbb7635c78513686a284c44dde2707dd7a3a | |
parent | 208cfe50456fb7bd2f42bbdbd681c2609b249c93 (diff) |
Set the mysqli error reporting to none, to prevent possible problems on PHP 8.1php81
-rw-r--r-- | core/Db/Adapter/Mysqli.php | 5 | ||||
-rw-r--r-- | core/Tracker/Db/Mysqli.php | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/core/Db/Adapter/Mysqli.php b/core/Db/Adapter/Mysqli.php index a46236c570..928e634294 100644 --- a/core/Db/Adapter/Mysqli.php +++ b/core/Db/Adapter/Mysqli.php @@ -82,6 +82,11 @@ class Mysqli extends Zend_Db_Adapter_Mysqli implements AdapterInterface return; } + // The default error reporting of mysqli changed in PHP 8.1. To circumvent problems in our error handling we set + // the erroring reporting to the default that was used prior PHP 8.1 + // See https://php.watch/versions/8.1/mysqli-error-mode for more details + mysqli_report(MYSQLI_REPORT_OFF); + parent::_connect(); $this->_connection->query('SET sql_mode = "' . Db::SQL_MODE . '"'); diff --git a/core/Tracker/Db/Mysqli.php b/core/Tracker/Db/Mysqli.php index 351c1534b8..ceaf12488a 100644 --- a/core/Tracker/Db/Mysqli.php +++ b/core/Tracker/Db/Mysqli.php @@ -105,6 +105,11 @@ class Mysqli extends Db $timer = $this->initProfiler(); } + // The default error reporting of mysqli changed in PHP 8.1. To circumvent problems in our error handling we set + // the erroring reporting to the default that was used prior PHP 8.1 + // See https://php.watch/versions/8.1/mysqli-error-mode for more details + mysqli_report(MYSQLI_REPORT_OFF); + $this->connection = mysqli_init(); |