From b70c3abd805df410d7b2e3983cbee0102f1e7edf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Thu, 10 Jan 2019 14:20:28 +0100 Subject: [PATCH] Remove check whether a internalId is already used See #2825 --- .../files/lib/system/file/upload/UploadHandler.class.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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); -- 2.20.1