From: Joshua Rüsweg Date: Thu, 31 Jan 2019 14:27:43 +0000 (+0100) Subject: Use normal for-loop instead of for (… in …) X-Git-Tag: 5.2.0_Alpha_1~296^2~13 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f1690aff5ba4071b56df485646b96c9d12c293ca;p=GitHub%2FWoltLab%2FWCF.git Use normal for-loop instead of for (… in …) See #2825 --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js index 5cb625eed8..4edb7e5952 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/File/Upload.js @@ -105,7 +105,7 @@ define(['Core', 'Language', 'Dom/Util', 'WoltLabSuite/Core/Ui/File/Delete', 'Upl }, _failure: function(uploadId, data, responseText, xhr, requestOptions) { - for (var i in this._fileElements[uploadId]) { + for (var i = 0, length = this._fileElements[uploadId].length; i < length; i++) { this._fileElements[uploadId][i].classList.add('uploadFailed'); elBySel('small', this._fileElements[uploadId][i]).innerHTML = ''; @@ -130,7 +130,7 @@ define(['Core', 'Language', 'Dom/Util', 'WoltLabSuite/Core/Ui/File/Delete', 'Upl }, _success: function(uploadId, data, responseText, xhr, requestOptions) { - for (var i in this._fileElements[uploadId]) { + for (var i = 0, length = this._fileElements[uploadId].length; i < length; i++) { if (data['files'][i] !== undefined) { if (this._options.imagePreview) { if (data['files'][i].image === null) {