From: Michael Date: Mon, 11 May 2020 18:59:36 +0000 (+0000) Subject: Use "quoteIdentifier" X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c5be1092d0538d02d0e0da88bec89e6232501728;hp=57b4c70f9e7965f8b513d6a673e64c23e8d162a7;p=friendica.git Use "quoteIdentifier" --- diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php index 8f599a67d7..bd54ecf8c5 100644 --- a/src/Database/DBStructure.php +++ b/src/Database/DBStructure.php @@ -657,7 +657,7 @@ class DBStructure private static function tableStructure($table) { // This query doesn't seem to be executable as a prepared statement - $indexes = DBA::toArray(DBA::p(sprintf("SHOW INDEX FROM `%s`", $table))); + $indexes = DBA::toArray(DBA::p("SHOW INDEX FROM " . DBA::quoteIdentifier($table))); $fields = DBA::selectToArray(['INFORMATION_SCHEMA' => 'COLUMNS'], ['COLUMN_NAME', 'COLUMN_TYPE', 'IS_NULLABLE', 'COLUMN_DEFAULT', 'EXTRA', @@ -717,7 +717,7 @@ class DBStructure $fielddata[$field['COLUMN_NAME']]['type'] = $field['COLUMN_TYPE']; if ($field['IS_NULLABLE'] == 'NO') { - $fielddata[$field['COLUMN_NAME']]['not null'] = 1; + $fielddata[$field['COLUMN_NAME']]['not null'] = true; } if (isset($field['COLUMN_DEFAULT'])) {