use wcf\system\WCF;
use wcf\util\ArrayUtil;
use wcf\util\FileUtil;
+use wcf\util\JSON;
use wcf\util\MessageUtil;
use wcf\util\StringUtil;
use wcf\util\UserRegistrationUtil;
// multiple attachments dir
static $dirs;
if ($dirs === null) {
- $dirs = \unserialize($this->readOption('attachmentUploadDir'));
+ try {
+ // SMF 2.1
+ $dirs = JSON::decode($this->readOption('attachmentUploadDir'));
+ } catch (\Exception $e) {
+ // SMF 2.0
+ $dirs = \unserialize($this->readOption('attachmentUploadDir'));
+ }
}
if (isset($dirs[$dir])) {