CodeIgniter 3.1.11 -> 3.4.5 (pocketarc fork) en PHP 8.3-fixes
- system/ vervangen door CodeIgniter 3.4.5 (pocketarc/codeigniter, PHP 8.2-8.5 compatibel) - config.php, mimes.php, user_agents.php en error-views bijgewerkt naar 3.4.5 - composer.json: php-constraint "^7.4 || ^8.0" zodat composer install op 8.3 werkt - PHP 8-fatals opgelost: count()/array-functies op FALSE/null, rekenen met lege strings, delen door nul, property zetten op FALSE, curly-brace string offsets, ongedefinieerde constanten, foute curl_setopt in Phantom_model::create_img - dynamic properties gedeclareerd in libraries, optionele parameters voor verplichte opgelost - vergelijkingen waar '' == 0 in PHP 8 anders uitvalt gecast naar (int) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 - 2019, British Columbia Institute of Technology
|
||||
* Copyright (c) 2019 - 2022, CodeIgniter Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -30,6 +30,7 @@
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 3.0.0
|
||||
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Drivers
|
||||
* @category Database
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/database/
|
||||
* @link https://codeigniter.com/userguide3/database/
|
||||
*/
|
||||
class CI_DB_pdo_mysql_driver extends CI_DB_pdo_driver {
|
||||
|
||||
@@ -142,34 +143,65 @@ class CI_DB_pdo_mysql_driver extends CI_DB_pdo_driver {
|
||||
|
||||
if ( ! empty($sql))
|
||||
{
|
||||
if (empty($this->options[PDO::MYSQL_ATTR_INIT_COMMAND]))
|
||||
if (class_exists('Pdo\\Mysql'))
|
||||
{
|
||||
$this->options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET SESSION sql_mode = '.$sql;
|
||||
$constant = constant('Pdo\\Mysql::ATTR_INIT_COMMAND');
|
||||
} else {
|
||||
$constant = PDO::MYSQL_ATTR_INIT_COMMAND;
|
||||
}
|
||||
|
||||
if (empty($this->options[$constant]))
|
||||
{
|
||||
$this->options[$constant] = 'SET SESSION sql_mode = '.$sql;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->options[PDO::MYSQL_ATTR_INIT_COMMAND] .= ', @@session.sql_mode = '.$sql;
|
||||
$this->options[$constant] .= ', @@session.sql_mode = '.$sql;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->compress === TRUE)
|
||||
{
|
||||
$this->options[PDO::MYSQL_ATTR_COMPRESS] = TRUE;
|
||||
if (class_exists('Pdo\\Mysql'))
|
||||
{
|
||||
$constant = constant('Pdo\\Mysql::ATTR_COMPRESS');
|
||||
} else {
|
||||
$constant = PDO::MYSQL_ATTR_COMPRESS;
|
||||
}
|
||||
|
||||
$this->options[$constant] = TRUE;
|
||||
}
|
||||
|
||||
if (is_array($this->encrypt))
|
||||
{
|
||||
$ssl = array();
|
||||
empty($this->encrypt['ssl_key']) OR $ssl[PDO::MYSQL_ATTR_SSL_KEY] = $this->encrypt['ssl_key'];
|
||||
empty($this->encrypt['ssl_cert']) OR $ssl[PDO::MYSQL_ATTR_SSL_CERT] = $this->encrypt['ssl_cert'];
|
||||
empty($this->encrypt['ssl_ca']) OR $ssl[PDO::MYSQL_ATTR_SSL_CA] = $this->encrypt['ssl_ca'];
|
||||
empty($this->encrypt['ssl_capath']) OR $ssl[PDO::MYSQL_ATTR_SSL_CAPATH] = $this->encrypt['ssl_capath'];
|
||||
empty($this->encrypt['ssl_cipher']) OR $ssl[PDO::MYSQL_ATTR_SSL_CIPHER] = $this->encrypt['ssl_cipher'];
|
||||
|
||||
if (defined('PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT') && isset($this->encrypt['ssl_verify']))
|
||||
if (class_exists('Pdo\\Mysql'))
|
||||
{
|
||||
$ssl[PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = $this->encrypt['ssl_verify'];
|
||||
$sslKey = constant('Pdo\\Mysql::ATTR_SSL_KEY');
|
||||
$sslCert = constant('Pdo\\Mysql::ATTR_SSL_CERT');
|
||||
$sslCA = constant('Pdo\\Mysql::ATTR_SSL_CA');
|
||||
$sslCAPath = constant('Pdo\\Mysql::ATTR_SSL_CAPATH');
|
||||
$sslCipher = constant('Pdo\\Mysql::ATTR_SSL_CIPHER');
|
||||
$verify = constant('Pdo\\Mysql::ATTR_SSL_VERIFY_SERVER_CERT');
|
||||
} else {
|
||||
$sslKey = PDO::MYSQL_ATTR_SSL_KEY;
|
||||
$sslCert = PDO::MYSQL_ATTR_SSL_CERT;
|
||||
$sslCA = PDO::MYSQL_ATTR_SSL_CA;
|
||||
$sslCAPath = PDO::MYSQL_ATTR_SSL_CAPATH;
|
||||
$sslCipher = PDO::MYSQL_ATTR_SSL_CIPHER;
|
||||
$verify = defined('PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT') ? PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT : null;
|
||||
}
|
||||
|
||||
$ssl = array();
|
||||
empty($this->encrypt['ssl_key']) OR $ssl[$sslKey] = $this->encrypt['ssl_key'];
|
||||
empty($this->encrypt['ssl_cert']) OR $ssl[$sslCert] = $this->encrypt['ssl_cert'];
|
||||
empty($this->encrypt['ssl_ca']) OR $ssl[$sslCA] = $this->encrypt['ssl_ca'];
|
||||
empty($this->encrypt['ssl_capath']) OR $ssl[$sslCAPath] = $this->encrypt['ssl_capath'];
|
||||
empty($this->encrypt['ssl_cipher']) OR $ssl[$sslCipher] = $this->encrypt['ssl_cipher'];
|
||||
|
||||
if ($verify && isset($this->encrypt['ssl_verify']))
|
||||
{
|
||||
$ssl[$verify] = $this->encrypt['ssl_verify'];
|
||||
}
|
||||
|
||||
// DO NOT use array_merge() here!
|
||||
|
||||
Reference in New Issue
Block a user