diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-06-30 11:03:24 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-06-30 11:10:10 +0200 |
commit | 0c711e1cfa204fcdc3ba6ac4cc38b7b881c1c246 (patch) | |
tree | cc7f68b29aa23383befade38d6d03fa98cec933b /lib/private/db | |
parent | 589f68ebf6dde3f0a804732a716bb6fd18363e00 (diff) | |
download | nextcloud-server-0c711e1cfa204fcdc3ba6ac4cc38b7b881c1c246.tar.gz nextcloud-server-0c711e1cfa204fcdc3ba6ac4cc38b7b881c1c246.zip |
Use get random bytes as uniqeid() is not unique in some cases
Fix #9161
Diffstat (limited to 'lib/private/db')
-rw-r--r-- | lib/private/db/migrator.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/db/migrator.php b/lib/private/db/migrator.php index 8dbfabe443c..6443cf4ed48 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()); } |