From 703e90fbc21de2eb1d9f1445b202346d47b747e3 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Sat, 4 Aug 2018 21:07:12 +0100 Subject: [PATCH] Cast variables as arrays to cover empty values (#8982) DO NOT DELETE THIS TEXT #### Please note > Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting. - [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/) #### Testers If you would like to test this pull request then please run: `./scripts/github-apply `, i.e `./scripts/github-apply 5926` --- LibreNMS/Validations/Database.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LibreNMS/Validations/Database.php b/LibreNMS/Validations/Database.php index 93ebda19fb..83931b71b8 100644 --- a/LibreNMS/Validations/Database.php +++ b/LibreNMS/Validations/Database.php @@ -220,7 +220,8 @@ class Database extends BaseValidation $columns = array_map(array($this, 'columnToSql'), $table_schema['Columns']); $indexes = array_map(array($this, 'indexToSql'), $table_schema['Indexes']); - $def = implode(', ', array_merge(array_values($columns), array_values($indexes))); + $def = implode(', ', array_merge(array_values((array)$columns), array_values((array)$indexes))); + var_dump($def); return "CREATE TABLE `$table` ($def);"; }