Skip to content

Commit

Permalink
Merge pull request Dolibarr#27632 from mdeweerd/fix/depr/mysqli_init
Browse files Browse the repository at this point in the history
Fix: Deprecated mysqli::init() in PHP8.1
  • Loading branch information
eldy authored Jan 18, 2024
2 parents d459977 + b4b0cdf commit f3d97a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion htdocs/core/db/mysqli.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,11 @@ class mysqliDoli extends mysqli
public function __construct($host, $user, $pass, $name, $port = 0, $socket = "")
{
$flags = 0;
parent::init();
if (PHP_VERSION_ID >= 80100) {
parent::__construct();
} else {
parent::init();
}
if (strpos($host, 'ssl://') === 0) {
$host = substr($host, 6);
parent::options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, false);
Expand Down

0 comments on commit f3d97a8

Please sign in to comment.