-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
3.2.3
-
PHP 7.2, SQL 2012
Yet another MSSQL abstraction layer bug that went out without regression testing.
When running the current 3.2.3 build against PHP 7.2. (specifically tested 7.2.11) it fails on line 271 of /phpbb/db/driver/mssqlnative.php:
return (count($row)) ? $row : false; |
The exception is:
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mssqlnative.php on line 271: count(): Parameter must be an array or an object that implements Countable
A simple fix is to change this code:
if ($row) |
{
|
foreach ($row as $key => $value)
|
{
|
$row[$key] = ($value === ' ' || $value === null) ? '' : $value; |
} // remove helper values from LIMIT queries |
if (isset($row['line2'])) |
{
|
unset($row['line2'], $row['line3']); |
}
|
}
|
return (count($row)) ? $row : false; |
|
To this:
if ($row) |
{
|
foreach ($row as $key => $value)
|
{
|
$row[$key] = ($value === ' ' || $value === null) ? '' : $value; |
} // remove helper values from LIMIT queries |
if (isset($row['line2'])) |
{
|
unset($row['line2'], $row['line3']); |
}
|
return $row; |
}
|
return false; |
|
- duplicates
-
PHPBB-15612 PHP warning with MSSQL on PHP 7.2
- Closed