Skip to content

Commit bfec5b6

Browse files
authored
Fix #270: Prevent null parameter on mb_strlen to avoid PHP 8.4 implicity nullable types deprecation
1 parent c00e9fb commit bfec5b6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Yii Framework 2 redis extension Change Log
44
2.0.20 under development
55
------------------------
66

7-
- no changes in this release.
7+
- Bug #270: Prevent null parameter on `mb_strlen` to avoid PHP 8.4 implicity nullable types deprecation (tehmaestro)
88

99

1010
2.0.19 February 13, 2025

src/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ public function executeCommand($name, $params = [])
766766
$params = array_merge(explode(' ', $name), $params);
767767
$command = '*' . count($params) . "\r\n";
768768
foreach ($params as $arg) {
769-
$command .= '$' . mb_strlen($arg, '8bit') . "\r\n" . $arg . "\r\n";
769+
$command .= '$' . mb_strlen($arg ?? '', '8bit') . "\r\n" . $arg . "\r\n";
770770
}
771771

772772
\Yii::trace("Executing Redis Command: {$name}", __METHOD__);

0 commit comments

Comments
 (0)