Merge branch 'master' of https://github.com/jelhan/croodle.git
This commit is contained in:
commit
43cd26c783
1 changed files with 6 additions and 6 deletions
|
@ -78,16 +78,16 @@ class DataHandler {
|
|||
protected function getNewId() {
|
||||
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
$length = 10;
|
||||
|
||||
$randomString = '';
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$randomString .= $characters[rand(0, strlen($characters) - 1)];
|
||||
}
|
||||
$randomString = '';
|
||||
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$randomString .= $characters[rand(0, strlen($characters) - 1)];
|
||||
}
|
||||
|
||||
// check if id is already used, generate new one if necessary
|
||||
if (file_exists(self::DATA_FOLDER.$randomString)) $randomString = getNewId();
|
||||
|
||||
return $randomString;
|
||||
return $randomString;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue