This commit is contained in:
main 2013-10-23 12:27:40 +02:00
commit 43cd26c783

View file

@ -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;
}
/*