From 6cd267fb259fab2aac09d541bdc0ebbb387e1caa Mon Sep 17 00:00:00 2001 From: Samuel Akopyan Date: Tue, 24 Sep 2024 20:32:11 +0300 Subject: [PATCH] PHP 8 compatibility: Fix passing null to string parameter parameter --- framework/console/CConsoleCommand.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/console/CConsoleCommand.php b/framework/console/CConsoleCommand.php index 0c1f65993..16e689d9e 100644 --- a/framework/console/CConsoleCommand.php +++ b/framework/console/CConsoleCommand.php @@ -229,6 +229,9 @@ abstract class CConsoleCommand extends CComponent $params=array(); // unnamed parameters foreach($args as $arg) { + if (is_null($arg)) + continue; + if(preg_match('/^--(\w+)(=(.*))?$/',$arg,$matches)) // an option { $name=$matches[1];