From 8d774175c220ce5a08475af309d8ea965ab40c6c Mon Sep 17 00:00:00 2001 From: Tybaze Date: Tue, 14 Feb 2023 18:48:48 +0100 Subject: [PATCH] Fix PHP8.1 sfForm - Unsupported operand types: array + null on sfForm::updateValues() Avoid error: Fatal error: Uncaught TypeError: Unsupported operand types: array + null in lib\form\sfForm.class.php:319 Step to reproduce : $form = new sfForm(); $form->updateValues(array('foo' => 'value')); PHP 5.3 coding style May use sfForm::getValues(), but as sfForm::updateValues() is a hack, it could be used before bind ($this->isBound = true); --- lib/form/sfForm.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/form/sfForm.class.php b/lib/form/sfForm.class.php index 16f23893f..4219541af 100644 --- a/lib/form/sfForm.class.php +++ b/lib/form/sfForm.class.php @@ -47,7 +47,7 @@ class sfForm implements ArrayAccess, Iterator, Countable protected $isBound = false; protected $taintedValues = array(); protected $taintedFiles = array(); - protected $values; + protected $values = array(); protected $defaults = array(); protected $fieldNames = array(); protected $options = array();