Commit 42ed08fa authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #404 in ZP/z-push from...

Merge pull request #404 in ZP/z-push from bugfix/ZP-1087-short-folderid-hash-collisions-on to develop

* commit '844e925b':
  ZP-1087 Also check backend2folderidCache for generated but not (yet) synchronized short folderids when hashing.
parents 4260a916 844e925b
......@@ -1057,7 +1057,7 @@ class ASDevice extends StateObject {
$cnt = 0;
// Collision avoiding. Append an increasing number to the string to hash
// until there aren't any collisions. Probably a smaller number is also sufficient.
while (isset($this->contentData[$folderId]) && $cnt < 10000) {
while ((isset($this->contentData[$folderId]) || in_array($folderId, $this->backend2folderidCache, true)) && $cnt < 10000) {
$folderId = substr($folderOrigin . dechex(crc32($backendid . $folderName . $cnt++)), 0, 6);
ZLog::Write(LOGLEVEL_WARN, sprintf("ASDevice->generateFolderHash(): collision avoiding nr %05d. Generated hash: '%s'", $cnt, $folderId));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment