From: Tim Düsterhus Date: Wed, 28 Apr 2021 08:48:33 +0000 (+0200) Subject: Check whether the media file is readable in MediaImporter X-Git-Tag: 5.4.0_Alpha_1~32^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ac4808ad2144ef82a3ae5e70abebd589de5e9acb;p=GitHub%2FWoltLab%2FWCF.git Check whether the media file is readable in MediaImporter --- diff --git a/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php b/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php index 1170d65d6a..04de79079e 100644 --- a/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php +++ b/wcfsetup/install/files/lib/system/importer/MediaImporter.class.php @@ -14,7 +14,7 @@ use wcf\system\WCF; * Imports cms media. * * @author Marcel Werk - * @copyright 2001-2019 WoltLab GmbH + * @copyright 2001-2021 WoltLab GmbH * @license GNU Lesser General Public License * @package WoltLabSuite\Core\System\Importer */ @@ -35,6 +35,11 @@ class MediaImporter extends AbstractImporter */ public function import($oldID, array $data, array $additionalData = []) { + // check file location + if (!\is_readable($additionalData['fileLocation'])) { + return 0; + } + $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']); $contents = [];