From: Matthias Schmidt Date: Sat, 17 Aug 2019 11:33:56 +0000 (+0200) Subject: Only return each index once in MysqlDatabaseEditor::getIndices() X-Git-Tag: 5.2.0_Beta_1~16^2~7^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f62c045dd3366ebc4e3932fe31aa4fb6fc85544e;p=GitHub%2FWoltLab%2FWCF.git Only return each index once in MysqlDatabaseEditor::getIndices() Close #3012 --- diff --git a/wcfsetup/install/files/lib/system/database/editor/DatabaseEditor.class.php b/wcfsetup/install/files/lib/system/database/editor/DatabaseEditor.class.php index 3592bd0e97..393c984a17 100644 --- a/wcfsetup/install/files/lib/system/database/editor/DatabaseEditor.class.php +++ b/wcfsetup/install/files/lib/system/database/editor/DatabaseEditor.class.php @@ -42,7 +42,7 @@ abstract class DatabaseEditor { abstract public function getColumns($tableName); /** - * Returns the indices of a table. + * Returns the names of indices of a table. * * @param string $tableName * @return array $indices diff --git a/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php b/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php index 5779a23b5b..91e92076ea 100644 --- a/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php +++ b/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php @@ -103,7 +103,7 @@ class MySQLDatabaseEditor extends DatabaseEditor { $indices[] = $row['Key_name']; } - return $indices; + return array_unique($indices); } /**