summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-07-01 09:51:45 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-07-01 09:51:45 +0200
commit88e6f5c318d1fcd08ac2182bbfbdf9b15ae34d17 (patch)
tree2d6aa5e7b3a3bfe3dcc5ab5c0f0cb6331c4bb052
parenta67d24377ed6024fd339acf0cdba891df3eaa6af (diff)
parent0c711e1cfa204fcdc3ba6ac4cc38b7b881c1c246 (diff)
downloadnextcloud-server-88e6f5c318d1fcd08ac2182bbfbdf9b15ae34d17.tar.gz
nextcloud-server-88e6f5c318d1fcd08ac2182bbfbdf9b15ae34d17.zip
Merge pull request #9292 from owncloud/issue/9161
Use get random bytes as uniqeid() is not unique in some cases
-rw-r--r--lib/private/db/migrator.php4
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());
}