From: Joshua Rüsweg Date: Thu, 10 Jan 2019 13:20:28 +0000 (+0100) Subject: Remove check whether a internalId is already used X-Git-Tag: 5.2.0_Alpha_1~296^2~46 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b70c3abd805df410d7b2e3983cbee0102f1e7edf;p=GitHub%2FWoltLab%2FWCF.git Remove check whether a internalId is already used See #2825 --- diff --git a/wcfsetup/install/files/lib/system/file/upload/UploadHandler.class.php b/wcfsetup/install/files/lib/system/file/upload/UploadHandler.class.php index 2515b11847..3272bae2ad 100644 --- a/wcfsetup/install/files/lib/system/file/upload/UploadHandler.class.php +++ b/wcfsetup/install/files/lib/system/file/upload/UploadHandler.class.php @@ -3,6 +3,7 @@ namespace wcf\system\file\upload; use wcf\system\exception\ImplementationException; use wcf\system\SingletonFactory; use wcf\system\WCF; +use wcf\util\StringUtil; /** * Handles uploads for files. @@ -44,10 +45,7 @@ class UploadHandler extends SingletonFactory { $this->fields[$field->getFieldId()] = $field; } else { - do { - $internalId = bin2hex(random_bytes(32)); - } - while (in_array($internalId, $this->getKnownInternalIds())); + $internalId = StringUtil::getRandomID(); $field->setInternalId($internalId);