From 0c711e1cfa204fcdc3ba6ac4cc38b7b881c1c246 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 30 Jun 2014 11:03:24 +0200 Subject: [PATCH] Use get random bytes as uniqeid() is not unique in some cases Fix #9161 --- lib/private/db/migrator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/db/migrator.php b/lib/private/db/migrator.php index 8dbfabe443..6443cf4ed4 100644 --- a/lib/private/db/migrator.php +++ b/lib/private/db/migrator.php @@ -84,7 +84,7 @@ class Migrator { * @return string */ protected function generateTemporaryTableName($name) { - return 'oc_' . $name . '_' . uniqid(); + return 'oc_' . $name . '_' . \OCP\Util::generateRandomBytes(13); } /** @@ -133,7 +133,7 @@ class Migrator { $indexName = $index->getName(); } else { // avoid conflicts in index names - $indexName = 'oc_' . uniqid(); + $indexName = 'oc_' . \OCP\Util::generateRandomBytes(13); } $newIndexes[] = new Index($indexName, $index->getColumns(), $index->isUnique(), $index->isPrimary()); }