Skip to content

Commit 116e091

Browse files
committed
Release v4.6.5
1 parent e4d3702 commit 116e091

File tree

7 files changed

+20
-43
lines changed

7 files changed

+20
-43
lines changed

system/CodeIgniter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class CodeIgniter
5555
/**
5656
* The current version of CodeIgniter Framework
5757
*/
58-
public const CI_VERSION = '4.6.4';
58+
public const CI_VERSION = '4.6.5';
5959

6060
/**
6161
* App startup time.

system/Database/MySQLi/Connection.php

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -207,21 +207,6 @@ public function connect(bool $persistent = false)
207207
$socket,
208208
$clientFlags,
209209
)) {
210-
// Prior to version 5.7.3, MySQL silently downgrades to an unencrypted connection if SSL setup fails
211-
if (($clientFlags & MYSQLI_CLIENT_SSL) !== 0 && version_compare($this->mysqli->client_info, 'mysqlnd 5.7.3', '<=')
212-
&& empty($this->mysqli->query("SHOW STATUS LIKE 'ssl_cipher'")->fetch_object()->Value)
213-
) {
214-
$this->mysqli->close();
215-
$message = 'MySQLi was configured for an SSL connection, but got an unencrypted connection instead!';
216-
log_message('error', $message);
217-
218-
if ($this->DBDebug) {
219-
throw new DatabaseException($message);
220-
}
221-
222-
return false;
223-
}
224-
225210
if (! $this->mysqli->set_charset($this->charset)) {
226211
log_message('error', "Database: Unable to set the configured connection charset ('{$this->charset}').");
227212

@@ -625,8 +610,6 @@ public function insertID(): int
625610
*/
626611
protected function _transBegin(): bool
627612
{
628-
$this->connID->autocommit(false);
629-
630613
return $this->connID->begin_transaction();
631614
}
632615

@@ -635,26 +618,14 @@ protected function _transBegin(): bool
635618
*/
636619
protected function _transCommit(): bool
637620
{
638-
if ($this->connID->commit()) {
639-
$this->connID->autocommit(true);
640-
641-
return true;
642-
}
643-
644-
return false;
621+
return $this->connID->commit();
645622
}
646623

647624
/**
648625
* Rollback Transaction
649626
*/
650627
protected function _transRollback(): bool
651628
{
652-
if ($this->connID->rollback()) {
653-
$this->connID->autocommit(true);
654-
655-
return true;
656-
}
657-
658-
return false;
629+
return $this->connID->rollback();
659630
}
660631
}

system/Database/Seeder.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Seeder
2727
/**
2828
* The name of the database group to use.
2929
*
30-
* @var non-empty-string
30+
* @var non-empty-string|null
3131
*/
3232
protected $DBGroup;
3333

@@ -92,10 +92,16 @@ public function __construct(Database $config, ?BaseConnection $db = null)
9292

9393
$this->config = &$config;
9494

95-
$db ??= Database::connect($this->DBGroup);
96-
97-
$this->db = $db;
98-
$this->forge = Database::forge($this->DBGroup);
95+
if (isset($this->DBGroup)) {
96+
$this->db = Database::connect($this->DBGroup);
97+
$this->forge = Database::forge($this->DBGroup);
98+
} elseif ($db instanceof BaseConnection) {
99+
$this->db = $db;
100+
$this->forge = Database::forge($db);
101+
} else {
102+
$this->db = Database::connect($config->defaultGroup);
103+
$this->forge = Database::forge($config->defaultGroup);
104+
}
99105
}
100106

101107
/**
@@ -145,7 +151,7 @@ public function call(string $class)
145151
}
146152

147153
/** @var Seeder $seeder */
148-
$seeder = new $class($this->config);
154+
$seeder = new $class($this->config, $this->db);
149155
$seeder->setSilent($this->silent)->run();
150156

151157
unset($seeder);

system/Debug/Toolbar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public function prepare(?RequestInterface $request = null, ?ResponseInterface $r
397397
helper('filesystem');
398398

399399
// Updated to microtime() so we can get history
400-
$time = sprintf('%.6f', Time::now()->format('U.u'));
400+
$time = sprintf('%.6F', Time::now()->format('U.u'));
401401

402402
if (! is_dir(WRITEPATH . 'debugbar')) {
403403
mkdir(WRITEPATH . 'debugbar', 0777);

system/Debug/Toolbar/Collectors/History.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function setFiles(string $current, int $limit = 20)
9090
$contents = @json_decode($contents);
9191
if (json_last_error() === JSON_ERROR_NONE) {
9292
preg_match('/debugbar_(.*)\.json$/s', $filename, $time);
93-
$time = sprintf('%.6f', $time[1] ?? 0);
93+
$time = sprintf('%.6F', $time[1] ?? 0);
9494

9595
// Debugbar files shown in History Collector
9696
$files[] = [

system/HTTP/ContentSecurityPolicy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public function enabled(): bool
303303
public function getStyleNonce(): string
304304
{
305305
if ($this->styleNonce === null) {
306-
$this->styleNonce = bin2hex(random_bytes(12));
306+
$this->styleNonce = base64_encode(random_bytes(12));
307307
$this->styleSrc[] = 'nonce-' . $this->styleNonce;
308308
}
309309

@@ -316,7 +316,7 @@ public function getStyleNonce(): string
316316
public function getScriptNonce(): string
317317
{
318318
if ($this->scriptNonce === null) {
319-
$this->scriptNonce = bin2hex(random_bytes(12));
319+
$this->scriptNonce = base64_encode(random_bytes(12));
320320
$this->scriptSrc[] = 'nonce-' . $this->scriptNonce;
321321
}
322322

system/Test/CIUnitTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ abstract class CIUnitTestCase extends TestCase
124124
*
125125
* @var string
126126
*/
127-
protected $basePath = SUPPORTPATH . 'Database';
127+
protected $basePath = TESTPATH . '_support/Database';
128128

129129
/**
130130
* The namespace(s) to help us find the migration classes.

0 commit comments

Comments
 (0)