Skip to content

Commit

Permalink
Fix PHP8.1 sfForm - Unsupported operand types: array + null on sfForm…
Browse files Browse the repository at this point in the history
…::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);
  • Loading branch information
Tybaze authored and thePanz committed Jan 17, 2024
1 parent 9d26d67 commit 8d77417
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/form/sfForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 8d77417

Please sign in to comment.