1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Type checks for db_verify::prepareResults()

This commit is contained in:
Nick Liu 2020-01-17 20:58:03 +01:00
parent ce510159a9
commit 1d72d48a35
No known key found for this signature in database
GPG Key ID: 1167C5F9C9897637

View File

@ -130,12 +130,14 @@ class db_verify
*/
private function diffStructurePermissive($expected, $actual)
{
$expected['default'] = isset($expected['default']) ? $expected['default'] : '';
$actual['default'] = isset($actual['default']) ? $actual['default'] : '';
if($expected['type'] === 'JSON') // Fix for JSON alias MySQL 5.7+
{
$expected['type'] = 'LONGTEXT';
}
// Permit actual text types that default to null even when
// expected does not explicitly default to null
if(0 === strcasecmp($expected['type'], $actual['type']) &&
@ -410,7 +412,7 @@ class db_verify
{
$this->{$results}[$tbl][$key]['_status'] = 'ok';
if(!is_array($sqlData[$type][$key]))
if(!isset($sqlData[$type][$key]) || !is_array($sqlData[$type][$key]))
{
$this->errors[$tbl]['_status'] = 'error'; // table status
$this->{$results}[$tbl][$key]['_status'] = "missing_$type"; // type status