-
Bug
-
Resolution: Fixed
-
Major
-
3.3.5
-
None
-
PHP 8.0.8
Running installer "Update files" leads to an exception in diff.php:
PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($var) must be of type Countable|array, bool given in phpbb/includes/diff/diff.php:172 |
The test in is_empty assumes $edit->orig and $edit->final are always arrays, but they're booleans in some cases:
class diff_op_delete extends diff_op |
{
|
function __construct($lines)
|
{
|
$this->orig = $lines; |
$this->final = false; |
}
|
|
|
function &reverse()
|
{
|
$reverse = new diff_op_add($this->orig); |
return $reverse; |
}
|
}
|
|
class diff_op_add extends diff_op |
{
|
function __construct($lines)
|
{
|
$this->final = $lines; |
$this->orig = false; |
}
|
|
|
function &reverse()
|
{
|
$reverse = new diff_op_delete($this->final); |
return $reverse; |
}
|
}
|
|
|
I'm not familiar with this code, but a workaround might be adding a test of is_array.