fuel / core

Fuel PHP Framework - The core of the Fuel v1 framework
http://fuelphp.com
802 stars 335 forks source link

PHP 8.3 Problem with View Class : COREPATH/classes/view.php @ line 586 #2207

Closed fledoux closed 2 months ago

fledoux commented 2 months ago

Fuel\Core\PhpErrorException [ Runtime Deprecated code usage ]: Automatic conversion of false to array is deprecated

if (strpos($key, '.') === false) { $this->data[$key] = $value; }

I replace by this, it works:

if (strpos($key, '.') === false) { if (isset($this->data) && !is_array($this->data)) { $this->data = array(); } $this->data[$key] = $value; }

WanWizard commented 2 months ago

How did you manage to make $this->data false?

I think this is not the actual problem, the problem is in the constructor, which should only accept objects or arrays, but doesn't do a very good job validating the input, as it allows false to fall through.