From e3eec5752f7bea8f42a4308b8de9f49fc6dfefc7 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 31 Jul 2016 09:33:14 +0200 Subject: [PATCH] Remove unnecessary parentheses --- .../system/exporter/IPB3xExporter.class.php | 48 +++++------ .../system/exporter/IPB4xExporter.class.php | 48 +++++------ .../exporter/Kunena3xExporter.class.php | 14 +-- .../system/exporter/MyBB16xExporter.class.php | 16 ++-- .../exporter/NodeBB0xRedisExporter.class.php | 4 +- .../exporter/PhpBB31xExporter.class.php | 18 ++-- .../system/exporter/PhpBB3xExporter.class.php | 18 ++-- .../system/exporter/SMF2xExporter.class.php | 10 +-- .../system/exporter/VB3or4xExporter.class.php | 34 ++++---- .../system/exporter/VB5xExporter.class.php | 10 +-- .../system/exporter/WBB2xExporter.class.php | 30 +++---- .../system/exporter/WBB3xExporter.class.php | 86 +++++++++---------- .../system/exporter/WBB4xExporter.class.php | 16 ++-- .../exporter/WordPress3xExporter.class.php | 14 +-- .../system/exporter/XF12xExporter.class.php | 16 ++-- 15 files changed, 191 insertions(+), 191 deletions(-) diff --git a/files/lib/system/exporter/IPB3xExporter.class.php b/files/lib/system/exporter/IPB3xExporter.class.php index 9f2cdec..c3658ee 100644 --- a/files/lib/system/exporter/IPB3xExporter.class.php +++ b/files/lib/system/exporter/IPB3xExporter.class.php @@ -204,10 +204,10 @@ class IPB3xExporter extends AbstractExporter { 'registrationDate' => $row['joined'], 'banned' => $row['member_banned'], 'registrationIpAddress' => UserUtil::convertIPv4To6($row['ip_address']), - 'enableGravatar' => ((!empty($row['pp_gravatar']) && $row['pp_gravatar'] == $row['email']) ? 1 : 0), + 'enableGravatar' => (!empty($row['pp_gravatar']) && $row['pp_gravatar'] == $row['email']) ? 1 : 0, 'signature' => self::fixMessage($row['signature']), 'profileHits' => $row['members_profile_views'], - 'userTitle' => ($row['title'] ?: ''), + 'userTitle' => $row['title'] ?: '', 'lastActivityTime' => $row['last_activity'] ]; @@ -334,7 +334,7 @@ class IPB3xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.user.group')->import($row['g_id'], [ 'groupName' => $row['g_title'], 'groupType' => $groupType, - 'userOnlineMarking' => (!empty($row['prefix']) ? ($row['prefix'].'%s'.$row['suffix']) : '%s') + 'userOnlineMarking' => !empty($row['prefix']) ? ($row['prefix'].'%s'.$row['suffix']) : '%s' ]); } } @@ -422,7 +422,7 @@ class IPB3xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.user.comment')->import($row['status_id'], [ 'objectID' => $row['status_member_id'], 'userID' => $row['status_author_id'], - 'username' => ($row['name'] ?: ''), + 'username' => $row['name'] ?: '', 'message' => self::fixStatusUpdate($row['status_content']), 'time' => $row['status_date'] ]); @@ -456,7 +456,7 @@ class IPB3xExporter extends AbstractExporter { 'commentID' => $row['reply_status_id'], 'time' => $row['reply_date'], 'userID' => $row['reply_member_id'], - 'username' => ($row['name'] ?: ''), + 'username' => $row['name'] ?: '', 'message' => self::fixStatusUpdate($row['reply_content']), ]); } @@ -517,8 +517,8 @@ class IPB3xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.conversation')->import($row['mt_id'], [ 'subject' => self::fixSubject($row['mt_title']), 'time' => $row['mt_date'], - 'userID' => ($row['mt_starter_id'] ?: null), - 'username' => ($row['mt_is_system'] ? 'System' : ($row['name'] ?: '')), + 'userID' => $row['mt_starter_id'] ?: null, + 'username' => $row['mt_is_system'] ? 'System' : ($row['name'] ?: ''), 'isDraft' => $row['mt_is_draft'] ]); } @@ -549,8 +549,8 @@ class IPB3xExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.conversation.message')->import($row['msg_id'], [ 'conversationID' => $row['msg_topic_id'], - 'userID' => ($row['msg_author_id'] ?: null), - 'username' => ($row['name'] ?: ''), + 'userID' => $row['msg_author_id'] ?: null, + 'username' => $row['name'] ?: '', 'message' => self::fixMessage($row['msg_post']), 'time' => $row['msg_date'] ]); @@ -583,8 +583,8 @@ class IPB3xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.conversation.user')->import(0, [ 'conversationID' => $row['map_topic_id'], 'participantID' => $row['map_user_id'], - 'username' => ($row['name'] ?: ''), - 'hideConversation' => ($row['map_left_time'] ? 1 : 0), + 'username' => $row['name'] ?: '', + 'hideConversation' => $row['map_left_time'] ? 1 : 0, 'isInvisible' => 0, 'lastVisitTime' => $row['map_read_time'] ]); @@ -649,9 +649,9 @@ class IPB3xExporter extends AbstractExporter { foreach ($this->boardCache[$parentID] as $board) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['id'], [ - 'parentID' => ($board['parent_id'] != -1 ? $board['parent_id'] : null), + 'parentID' => $board['parent_id'] != -1 ? $board['parent_id'] : null, 'position' => $board['position'], - 'boardType' => ($board['redirect_on'] ? Board::TYPE_LINK : ($board['sub_can_post'] ? Board::TYPE_BOARD : Board::TYPE_CATEGORY)), + 'boardType' => $board['redirect_on'] ? Board::TYPE_LINK : ($board['sub_can_post'] ? Board::TYPE_BOARD : Board::TYPE_CATEGORY), 'title' => self::fixSubject($board['name']), 'description' => $board['description'], 'externalURL' => $board['redirect_url'], @@ -712,10 +712,10 @@ class IPB3xExporter extends AbstractExporter { 'username' => $row['starter_name'], 'views' => $row['views'], 'isSticky' => $row['pinned'], - 'isDisabled' => ($row['approved'] == 0 ? 1 : 0), - 'isClosed' => ($row['state'] == 'close' ? 1 : 0), - 'isDeleted' => ($row['tdelete_time'] ? 1 : 0), - 'movedThreadID' => ($row['moved_to'] ? intval($row['moved_to']) : null), + 'isDisabled' => $row['approved'] == 0 ? 1 : 0, + 'isClosed' => $row['state'] == 'close' ? 1 : 0, + 'isDeleted' => $row['tdelete_time'] ? 1 : 0, + 'movedThreadID' => $row['moved_to'] ? intval($row['moved_to']) : null, 'movedTime' => $row['moved_on'], 'deleteTime' => $row['tdelete_time'], 'lastPostTime' => $row['last_post'] @@ -751,12 +751,12 @@ class IPB3xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.post')->import($row['pid'], [ 'threadID' => $row['topic_id'], 'userID' => $row['author_id'], - 'username' => ($row['author_name'] ?: ''), + 'username' => $row['author_name'] ?: '', 'message' => self::fixMessage($row['post']), 'time' => $row['post_date'], - 'isDeleted' => ($row['queued'] == 3 ? 1 : 0), - 'isDisabled' => ($row['queued'] == 2 ? 1 : 0), - 'lastEditTime' => ($row['edit_time'] ?: 0), + 'isDeleted' => $row['queued'] == 3 ? 1 : 0, + 'isDisabled' => $row['queued'] == 2 ? 1 : 0, + 'lastEditTime' => $row['edit_time'] ?: 0, 'editorID' => null, 'editReason' => $row['post_edit_reason'], 'ipAddress' => UserUtil::convertIPv4To6($row['ip_address']), @@ -834,7 +834,7 @@ class IPB3xExporter extends AbstractExporter { 'question' => self::fixSubject($data[1]['question']), 'time' => $row['start_date'], 'isPublic' => $row['poll_view_voters'], - 'maxVotes' => (!empty($data[1]['multi']) ? count($data[1]['choice']) : 1), + 'maxVotes' => !empty($data[1]['multi']) ? count($data[1]['choice']) : 1, 'votes' => $row['votes'] ]); @@ -922,7 +922,7 @@ class IPB3xExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.like')->import(0, [ 'objectID' => $row['topic_firstpost'], - 'objectUserID' => ($row['starter_id'] ?: null), + 'objectUserID' => $row['starter_id'] ?: null, 'userID' => $row['like_member_id'], 'likeValue' => Like::LIKE, 'time' => $row['like_added'] @@ -985,7 +985,7 @@ class IPB3xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter($objectType)->import($row['attach_id'], [ 'objectID' => $row['attach_rel_id'], - 'userID' => ($row['attach_member_id'] ?: null), + 'userID' => $row['attach_member_id'] ?: null, 'filename' => $row['attach_file'], 'filesize' => $row['attach_filesize'], 'isImage' => $row['attach_is_image'], diff --git a/files/lib/system/exporter/IPB4xExporter.class.php b/files/lib/system/exporter/IPB4xExporter.class.php index de7b20d..6ea7e87 100644 --- a/files/lib/system/exporter/IPB4xExporter.class.php +++ b/files/lib/system/exporter/IPB4xExporter.class.php @@ -206,12 +206,12 @@ class IPB4xExporter extends AbstractExporter { 'password' => '', 'email' => $row['email'], 'registrationDate' => $row['joined'], - 'banned' => ($row['temp_ban'] == -1 ? 1 : 0), + 'banned' => $row['temp_ban'] == -1 ? 1 : 0, 'registrationIpAddress' => UserUtil::convertIPv4To6($row['ip_address']), - 'enableGravatar' => ((!empty($row['pp_gravatar']) && $row['pp_gravatar'] == $row['email']) ? 1 : 0), + 'enableGravatar' => (!empty($row['pp_gravatar']) && $row['pp_gravatar'] == $row['email']) ? 1 : 0, 'signature' => self::fixMessage($row['signature']), 'profileHits' => $row['members_profile_views'], - 'userTitle' => ($row['member_title'] ?: ''), + 'userTitle' => $row['member_title'] ?: '', 'lastActivityTime' => $row['last_activity'] ]; @@ -316,7 +316,7 @@ class IPB4xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.user.group')->import($row['g_id'], [ 'groupName' => $this->getLanguageVar('core_group', $row['g_id']), 'groupType' => $groupType, - 'userOnlineMarking' => (!empty($row['prefix']) ? ($row['prefix'].'%s'.$row['suffix']) : '%s') + 'userOnlineMarking' => !empty($row['prefix']) ? ($row['prefix'].'%s'.$row['suffix']) : '%s' ]); } } @@ -387,7 +387,7 @@ class IPB4xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.user.comment')->import($row['status_id'], [ 'objectID' => $row['status_member_id'], 'userID' => $row['status_author_id'], - 'username' => ($row['name'] ?: ''), + 'username' => $row['name'] ?: '', 'message' => self::fixMessage($row['status_content']), 'time' => $row['status_date'] ]); @@ -421,7 +421,7 @@ class IPB4xExporter extends AbstractExporter { 'commentID' => $row['reply_status_id'], 'time' => $row['reply_date'], 'userID' => $row['reply_member_id'], - 'username' => ($row['name'] ?: ''), + 'username' => $row['name'] ?: '', 'message' => self::fixMessage($row['reply_content']), ]); } @@ -490,8 +490,8 @@ class IPB4xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.conversation')->import($row['mt_id'], [ 'subject' => $row['mt_title'], 'time' => $row['mt_date'], - 'userID' => ($row['mt_starter_id'] ?: null), - 'username' => ($row['mt_is_system'] ? 'System' : ($row['name'] ?: '')), + 'userID' => $row['mt_starter_id'] ?: null, + 'username' => $row['mt_is_system'] ? 'System' : ($row['name'] ?: ''), 'isDraft' => $row['mt_is_draft'] ]); } @@ -522,8 +522,8 @@ class IPB4xExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.conversation.message')->import($row['msg_id'], [ 'conversationID' => $row['msg_topic_id'], - 'userID' => ($row['msg_author_id'] ?: null), - 'username' => ($row['name'] ?: ''), + 'userID' => $row['msg_author_id'] ?: null, + 'username' => $row['name'] ?: '', 'message' => self::fixMessage($row['msg_post']), 'time' => $row['msg_date'] ]); @@ -556,8 +556,8 @@ class IPB4xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.conversation.user')->import(0, [ 'conversationID' => $row['map_topic_id'], 'participantID' => $row['map_user_id'], - 'username' => ($row['name'] ?: ''), - 'hideConversation' => ($row['map_left_time'] ? 1 : 0), + 'username' => $row['name'] ?: '', + 'hideConversation' => $row['map_left_time'] ? 1 : 0, 'isInvisible' => 0, 'lastVisitTime' => $row['map_read_time'] ]); @@ -622,13 +622,13 @@ class IPB4xExporter extends AbstractExporter { foreach ($this->boardCache[$parentID] as $board) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['id'], [ - 'parentID' => ($board['parent_id'] != -1 ? $board['parent_id'] : null), + 'parentID' => $board['parent_id'] != -1 ? $board['parent_id'] : null, 'position' => $board['position'], - 'boardType' => ($board['redirect_on'] ? Board::TYPE_LINK : ($board['sub_can_post'] ? Board::TYPE_BOARD : Board::TYPE_CATEGORY)), + 'boardType' => $board['redirect_on'] ? Board::TYPE_LINK : ($board['sub_can_post'] ? Board::TYPE_BOARD : Board::TYPE_CATEGORY), 'title' => $this->getLanguageVar('forums_forum', $board['id']), 'description' => $this->getLanguageVar('forums_forum', $board['id'], 'desc'), 'descriptionUseHtml' => 1, - 'externalURL' => ($board['redirect_url'] ?: ''), + 'externalURL' => $board['redirect_url'] ?: '', 'countUserPosts' => $board['inc_postcount'], 'clicks' => $board['redirect_hits'], 'posts' => $board['posts'], @@ -686,9 +686,9 @@ class IPB4xExporter extends AbstractExporter { 'username' => $row['starter_name'], 'views' => $row['views'], 'isSticky' => $row['pinned'], - 'isDisabled' => ($row['approved'] == 0 ? 1 : 0), - 'isClosed' => ($row['state'] == 'close' ? 1 : 0), - 'movedThreadID' => ($row['moved_to'] ? intval($row['moved_to']) : null), + 'isDisabled' => $row['approved'] == 0 ? 1 : 0, + 'isClosed' => $row['state'] == 'close' ? 1 : 0, + 'movedThreadID' => $row['moved_to'] ? intval($row['moved_to']) : null, 'movedTime' => $row['moved_on'], 'lastPostTime' => $row['last_post'] ]; @@ -726,9 +726,9 @@ class IPB4xExporter extends AbstractExporter { 'username' => $row['author_name'], 'message' => self::fixMessage($row['post']), 'time' => $row['post_date'], - 'isDeleted' => ($row['queued'] == 3 ? 1 : 0), - 'isDisabled' => ($row['queued'] == 2 ? 1 : 0), - 'lastEditTime' => ($row['edit_time'] ?: 0), + 'isDeleted' => ($row['queued'] == 3) ? 1 : 0, + 'isDisabled' => ($row['queued'] == 2) ? 1 : 0, + 'lastEditTime' => $row['edit_time'] ?: 0, 'editorID' => null, 'editReason' => $row['post_edit_reason'], 'ipAddress' => UserUtil::convertIPv4To6($row['ip_address']), @@ -815,7 +815,7 @@ class IPB4xExporter extends AbstractExporter { 'question' => $data[1]['question'], 'time' => $row['start_date'], 'isPublic' => $row['poll_view_voters'], - 'maxVotes' => (!empty($data[1]['multi']) ? count($data[1]['choice']) : 1), + 'maxVotes' => !empty($data[1]['multi']) ? count($data[1]['choice']) : 1, 'votes' => $row['votes'] ]); @@ -908,7 +908,7 @@ class IPB4xExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.like')->import(0, [ 'objectID' => $row['type_id'], - 'objectUserID' => ($row['author_id'] ?: null), + 'objectUserID' => $row['author_id'] ?: null, 'userID' => $row['member_id'], 'likeValue' => Like::LIKE, 'time' => $row['rep_date'] @@ -973,7 +973,7 @@ class IPB4xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter($objectType)->import($row['attach_id'], [ 'objectID' => $row['id2'], - 'userID' => ($row['attach_member_id'] ?: null), + 'userID' => $row['attach_member_id'] ?: null, 'filename' => $row['attach_file'], 'filesize' => $row['attach_filesize'], 'isImage' => $row['attach_is_image'], diff --git a/files/lib/system/exporter/Kunena3xExporter.class.php b/files/lib/system/exporter/Kunena3xExporter.class.php index 2affb02..cca1592 100644 --- a/files/lib/system/exporter/Kunena3xExporter.class.php +++ b/files/lib/system/exporter/Kunena3xExporter.class.php @@ -205,7 +205,7 @@ class Kunena3xExporter extends AbstractExporter { 'username' => $row['username'], 'password' => StringUtil::getRandomID(), 'email' => $row['email'], - 'banned' => ($row['banned'] ? 1 : 0), + 'banned' => $row['banned'] ? 1 : 0, 'registrationDate' => @strtotime($row['registerDate']), 'lastActivityTime' => @strtotime($row['lastvisitDate']), 'signature' => self::fixBBCodes($row['signature']) @@ -364,9 +364,9 @@ class Kunena3xExporter extends AbstractExporter { foreach ($this->boardCache[$parentID] as $board) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['id'], [ - 'parentID' => ($board['parent_id'] ?: null), + 'parentID' => $board['parent_id'] ?: null, 'position' => $board['ordering'], - 'boardType' => ($board['parent_id'] ? 0 : 1), + 'boardType' => $board['parent_id'] ? 0 : 1, 'title' => $board['name'], 'description' => $board['description'], 'isClosed' => $board['locked'] ? 1 : 0 @@ -403,11 +403,11 @@ class Kunena3xExporter extends AbstractExporter { 'topic' => $row['subject'], 'time' => $row['first_post_time'], 'userID' => $row['first_post_userid'], - 'username' => ($row['first_post_guest_name'] ?: ''), + 'username' => $row['first_post_guest_name'] ?: '', 'views' => $row['hits'], 'isSticky' => $row['ordering'] == 1 ? 1 : 0, 'isClosed' => $row['locked'] == 1 ? 1 : 0, - 'movedThreadID' => ($row['moved_id'] ? $row['moved_id'] : null) + 'movedThreadID' => $row['moved_id'] ? $row['moved_id'] : null ]; ImportHandler::getInstance()->getImporter('com.woltlab.wbb.thread')->import($row['id'], $data); @@ -445,7 +445,7 @@ class Kunena3xExporter extends AbstractExporter { 'message' => self::fixBBCodes($row['message']), 'time' => $row['time'], 'ipAddress' => UserUtil::convertIPv4To6($row['ip']), - 'isClosed' => ($row['locked'] ? 1 : 0), + 'isClosed' => $row['locked'] ? 1 : 0, 'editorID' => null ]); } @@ -479,7 +479,7 @@ class Kunena3xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.attachment')->import($row['id'], [ 'objectID' => $row['mesid'], - 'userID' => ($row['userid'] ?: null), + 'userID' => $row['userid'] ?: null, 'filename' => $row['filename'], 'filesize' => $row['size'], 'fileType' => $row['filetype'], diff --git a/files/lib/system/exporter/MyBB16xExporter.class.php b/files/lib/system/exporter/MyBB16xExporter.class.php index c9e8e36..83cc0c2 100644 --- a/files/lib/system/exporter/MyBB16xExporter.class.php +++ b/files/lib/system/exporter/MyBB16xExporter.class.php @@ -659,7 +659,7 @@ class MyBB16xExporter extends AbstractExporter { 'hideConversation' => $row['deletetime'] ? 1 : 0, 'isInvisible' => (isset($recipients['bcc']) && in_array($row['uid'], $recipients['bcc'])) ? 1 : 0, 'lastVisitTime' => $row['readtime'] - ], ['labelIDs' => ($row['folder'] > 4 ? [$row['folder']] : [])]); + ], ['labelIDs' => ($row['folder'] > 4) ? [$row['folder']] : []]); } } @@ -704,9 +704,9 @@ class MyBB16xExporter extends AbstractExporter { foreach ($this->boardCache[$parentID] as $board) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['fid'], [ - 'parentID' => ($board['pid'] ?: null), + 'parentID' => $board['pid'] ?: null, 'position' => $board['disporder'], - 'boardType' => ($board['linkto'] ? Board::TYPE_LINK : ($board['type'] == 'c' ? Board::TYPE_CATEGORY : Board::TYPE_BOARD)), + 'boardType' => $board['linkto'] ? Board::TYPE_LINK : ($board['type'] == 'c' ? Board::TYPE_CATEGORY : Board::TYPE_BOARD), 'title' => $board['name'], 'description' => $board['description'], 'descriptionUseHtml' => 1, // cannot be disabled @@ -795,7 +795,7 @@ class MyBB16xExporter extends AbstractExporter { 'message' => self::fixBBCodes($row['message']), 'time' => $row['dateline'], 'isDisabled' => $row['visible'] ? 0 : 1, - 'editorID' => ($row['edituid'] ?: null), + 'editorID' => $row['edituid'] ?: null, 'editor' => $row['editor'] ?: '', 'lastEditTime' => $row['edittime'], 'editCount' => $row['editor'] ? 1 : 0, @@ -850,7 +850,7 @@ class MyBB16xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.attachment')->import($row['aid'], [ 'objectID' => $row['pid'], - 'userID' => ($row['uid'] ?: null), + 'userID' => $row['uid'] ?: null, 'filename' => $row['filename'], 'filesize' => $row['filesize'], 'fileType' => $row['filetype'], @@ -1031,9 +1031,9 @@ class MyBB16xExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.like')->import($row['rid'], [ 'objectID' => $row['pid'], - 'objectUserID' => ($row['uid'] ?: null), + 'objectUserID' => $row['uid'] ?: null, 'userID' => $row['adduid'], - 'likeValue' => ($row['reputation'] > 0 ? Like::LIKE : Like::DISLIKE), + 'likeValue' => ($row['reputation'] > 0) ? Like::LIKE : Like::DISLIKE, 'time' => $row['dateline'] ]); } @@ -1188,7 +1188,7 @@ class MyBB16xExporter extends AbstractExporter { foreach ($permissions as $permission) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.acl')->import(0, [ 'objectID' => $row['fid'], - ($row['isgroup'] ? 'groupID' : 'userID') => $row['id'], + $row['isgroup'] ? 'groupID' : 'userID' => $row['id'], 'optionValue' => $row[$mybbPermission] ], [ 'optionName' => $permission diff --git a/files/lib/system/exporter/NodeBB0xRedisExporter.class.php b/files/lib/system/exporter/NodeBB0xRedisExporter.class.php index 6577ef2..2e79051 100644 --- a/files/lib/system/exporter/NodeBB0xRedisExporter.class.php +++ b/files/lib/system/exporter/NodeBB0xRedisExporter.class.php @@ -256,7 +256,7 @@ class NodeBB0xRedisExporter extends AbstractExporter { foreach ($this->boardCache[$parentID] as $board) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['cid'], [ - 'parentID' => ($board['parentCid'] ?: null), + 'parentID' => $board['parentCid'] ?: null, 'position' => $board['order'] ?: 0, 'boardType' => $board['link'] ? Board::TYPE_LINK : Board::TYPE_BOARD, 'title' => $board['name'], @@ -344,7 +344,7 @@ class NodeBB0xRedisExporter extends AbstractExporter { 'time' => intval($row['timestamp'] / 1000), 'isDeleted' => $row['deleted'], 'deleteTime' => TIME_NOW, - 'editorID' => ($row['editor'] ?: null), + 'editorID' => $row['editor'] ?: null, 'editor' => $this->database->hget('user:'.$row['editor'], 'username'), 'lastEditTime' => intval($row['edited'] / 1000), 'editCount' => $row['edited'] ? 1 : 0 diff --git a/files/lib/system/exporter/PhpBB31xExporter.class.php b/files/lib/system/exporter/PhpBB31xExporter.class.php index 8b2b23a..4920df8 100644 --- a/files/lib/system/exporter/PhpBB31xExporter.class.php +++ b/files/lib/system/exporter/PhpBB31xExporter.class.php @@ -250,7 +250,7 @@ class PhpBB31xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.user.group')->import($row['group_id'], [ 'groupName' => $row['group_name'], 'groupType' => $groupType, - 'userOnlineMarking' => ($row['group_colour'] ? '%s' : '%s'), + 'userOnlineMarking' => $row['group_colour'] ? '%s' : '%s', 'showOnTeamPage' => $row['group_legend'] ]); } @@ -866,7 +866,7 @@ class PhpBB31xExporter extends AbstractExporter { 'hideConversation' => $row['pm_deleted'], 'isInvisible' => in_array('u_'.$row['user_id'], $bcc) ? 1 : 0, 'lastVisitTime' => $row['pm_new'] ? 0 : $row['message_time'] - ], ['labelIDs' => ($row['folder_id'] > 0 ? [$row['folder_id']] : [])]); + ], ['labelIDs' => $row['folder_id'] > 0 ? [$row['folder_id']] : []]); } } @@ -928,9 +928,9 @@ class PhpBB31xExporter extends AbstractExporter { foreach ($this->boardCache[$parentID] as $board) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['forum_id'], [ - 'parentID' => ($board['parent_id'] ?: null), + 'parentID' => $board['parent_id'] ?: null, 'position' => $board['left_id'], - 'boardType' => ($board['forum_type'] == self::BOARD_TYPE_LINK ? Board::TYPE_LINK : ($board['forum_type'] == self::BOARD_TYPE_CATEGORY ? Board::TYPE_CATEGORY : Board::TYPE_BOARD)), + 'boardType' => $board['forum_type'] == self::BOARD_TYPE_LINK ? Board::TYPE_LINK : ($board['forum_type'] == self::BOARD_TYPE_CATEGORY ? Board::TYPE_CATEGORY : Board::TYPE_BOARD), 'title' => StringUtil::decodeHTML($board['forum_name']), 'description' => $board['forum_desc'], 'descriptionUseHtml' => 1, // cannot be disabled @@ -1025,7 +1025,7 @@ class PhpBB31xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.post')->import($row['post_id'], [ 'threadID' => $row['topic_id'], 'userID' => $row['poster_id'], - 'username' => ($row['post_username'] ?: (StringUtil::decodeHTML($row['username']) ?: '')), + 'username' => $row['post_username'] ?: (StringUtil::decodeHTML($row['username']) ?: ''), 'subject' => StringUtil::decodeHTML($row['post_subject']), 'message' => self::fixBBCodes(StringUtil::decodeHTML($row['post_text']), $row['bbcode_uid']), 'time' => $row['post_time'], @@ -1033,11 +1033,11 @@ class PhpBB31xExporter extends AbstractExporter { 'isDeleted' => $row['post_visibility'] == self::ITEM_DELETED ? 1 : 0, 'deleteTime' => $row['post_delete_time'], 'isClosed' => $row['post_edit_locked'] ? 1 : 0, - 'editorID' => ($row['post_edit_user'] ?: null), + 'editorID' => $row['post_edit_user'] ?: null, 'editor' => $row['editorName'] ?: '', 'lastEditTime' => $row['post_edit_time'], 'editCount' => $row['post_edit_count'], - 'editReason' => (!empty($row['post_edit_reason']) ? $row['post_edit_reason'] : ''), + 'editReason' => !empty($row['post_edit_reason']) ? $row['post_edit_reason'] : '', 'attachments' => $row['attachments'], 'enableHtml' => 0, 'ipAddress' => UserUtil::convertIPv4To6($row['poster_ip']) @@ -1130,7 +1130,7 @@ class PhpBB31xExporter extends AbstractExporter { 'question' => $row['poll_title'], 'time' => $row['poll_start'], 'endTime' => $row['poll_length'] ? $row['poll_start'] + $row['poll_length'] : 0, - 'isChangeable' => ($row['poll_vote_change'] ? 1 : 0), + 'isChangeable' => $row['poll_vote_change'] ? 1 : 0, 'isPublic' => 0, 'maxVotes' => $row['poll_max_options'], 'votes' => $row['poll_votes'] @@ -1455,7 +1455,7 @@ class PhpBB31xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.'.($conversation ? 'wcf.conversation' : 'wbb').'.attachment')->import(0, [ // TODO: support inline attachments 'objectID' => $row['post_msg_id'], - 'userID' => ($row['poster_id'] ?: null), + 'userID' => $row['poster_id'] ?: null, 'filename' => $row['real_filename'], 'filesize' => $row['filesize'], 'fileType' => $row['mimetype'], diff --git a/files/lib/system/exporter/PhpBB3xExporter.class.php b/files/lib/system/exporter/PhpBB3xExporter.class.php index 252b76b..4854e7f 100644 --- a/files/lib/system/exporter/PhpBB3xExporter.class.php +++ b/files/lib/system/exporter/PhpBB3xExporter.class.php @@ -239,7 +239,7 @@ class PhpBB3xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.user.group')->import($row['group_id'], [ 'groupName' => $row['group_name'], 'groupType' => $groupType, - 'userOnlineMarking' => ($row['group_colour'] ? '%s' : '%s'), + 'userOnlineMarking' => $row['group_colour'] ? '%s' : '%s', 'showOnTeamPage' => $row['group_legend'] ]); } @@ -803,7 +803,7 @@ class PhpBB3xExporter extends AbstractExporter { 'hideConversation' => $row['pm_deleted'], 'isInvisible' => in_array('u_'.$row['user_id'], $bcc) ? 1 : 0, 'lastVisitTime' => $row['pm_new'] ? 0 : $row['message_time'] - ], ['labelIDs' => ($row['folder_id'] > 0 ? [$row['folder_id']] : [])]); + ], ['labelIDs' => ($row['folder_id'] > 0) ? [$row['folder_id']] : []]); } } @@ -865,9 +865,9 @@ class PhpBB3xExporter extends AbstractExporter { foreach ($this->boardCache[$parentID] as $board) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['forum_id'], [ - 'parentID' => ($board['parent_id'] ?: null), + 'parentID' => $board['parent_id'] ?: null, 'position' => $board['left_id'], - 'boardType' => ($board['forum_type'] == self::BOARD_TYPE_LINK ? Board::TYPE_LINK : ($board['forum_type'] == self::BOARD_TYPE_CATEGORY ? Board::TYPE_CATEGORY : Board::TYPE_BOARD)), + 'boardType' => ($board['forum_type'] == self::BOARD_TYPE_LINK) ? Board::TYPE_LINK : (($board['forum_type'] == self::BOARD_TYPE_CATEGORY) ? Board::TYPE_CATEGORY : Board::TYPE_BOARD), 'title' => StringUtil::decodeHTML($board['forum_name']), 'description' => $board['forum_desc'], 'descriptionUseHtml' => 1, // cannot be disabled @@ -960,17 +960,17 @@ class PhpBB3xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.post')->import($row['post_id'], [ 'threadID' => $row['topic_id'], 'userID' => $row['poster_id'], - 'username' => ($row['post_username'] ?: (StringUtil::decodeHTML($row['username']) ?: '')), + 'username' => $row['post_username'] ?: (StringUtil::decodeHTML($row['username']) ?: ''), 'subject' => StringUtil::decodeHTML($row['post_subject']), 'message' => self::fixBBCodes(StringUtil::decodeHTML($row['post_text']), $row['bbcode_uid']), 'time' => $row['post_time'], 'isDisabled' => $row['post_approved'] ? 0 : 1, 'isClosed' => $row['post_edit_locked'] ? 1 : 0, - 'editorID' => ($row['post_edit_user'] ?: null), + 'editorID' => $row['post_edit_user'] ?: null, 'editor' => $row['editorName'] ?: '', 'lastEditTime' => $row['post_edit_time'], 'editCount' => $row['post_edit_count'], - 'editReason' => (!empty($row['post_edit_reason']) ? $row['post_edit_reason'] : ''), + 'editReason' => !empty($row['post_edit_reason']) ? $row['post_edit_reason'] : '', 'attachments' => $row['attachments'], 'enableHtml' => 0, 'ipAddress' => UserUtil::convertIPv4To6($row['poster_ip']) @@ -1063,7 +1063,7 @@ class PhpBB3xExporter extends AbstractExporter { 'question' => $row['poll_title'], 'time' => $row['poll_start'], 'endTime' => $row['poll_length'] ? $row['poll_start'] + $row['poll_length'] : 0, - 'isChangeable' => ($row['poll_vote_change'] ? 1 : 0), + 'isChangeable' => $row['poll_vote_change'] ? 1 : 0, 'isPublic' => 0, 'maxVotes' => $row['poll_max_options'], 'votes' => $row['poll_votes'] @@ -1388,7 +1388,7 @@ class PhpBB3xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.'.($conversation ? 'wcf.conversation' : 'wbb').'.attachment')->import(0, [ // TODO: support inline attachments 'objectID' => $row['post_msg_id'], - 'userID' => ($row['poster_id'] ?: null), + 'userID' => $row['poster_id'] ?: null, 'filename' => $row['real_filename'], 'filesize' => $row['filesize'], 'fileType' => $row['mimetype'], diff --git a/files/lib/system/exporter/SMF2xExporter.class.php b/files/lib/system/exporter/SMF2xExporter.class.php index cbed432..1f0c4cb 100644 --- a/files/lib/system/exporter/SMF2xExporter.class.php +++ b/files/lib/system/exporter/SMF2xExporter.class.php @@ -311,7 +311,7 @@ class SMF2xExporter extends AbstractExporter { 'password' => '', 'email' => $row['email_address'], 'registrationDate' => $row['date_registered'], - 'banned' => ($row['ban_time'] && $row['banExpire'] === null ? 1 : 0), // only permabans are imported + 'banned' => ($row['ban_time'] && $row['banExpire'] === null) ? 1 : 0, // only permabans are imported 'banReason' => $row['banReason'], 'activationCode' => $row['validation_code'] ? UserRegistrationUtil::getActivationCode() : 0, // smf's codes are strings 'registrationIpAddress' => $row['member_ip'], // member_ip2 is HTTP_X_FORWARDED_FOR @@ -809,7 +809,7 @@ class SMF2xExporter extends AbstractExporter { foreach ($this->boardCache[$parentID] as $board) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['id_board'], [ - 'parentID' => ($board['id_parent'] ?: 'cat-'.$board['id_cat']), + 'parentID' => $board['id_parent'] ?: 'cat-'.$board['id_cat'], 'position' => $board['board_order'], 'boardType' => $board['redirect'] ? Board::TYPE_LINK : Board::TYPE_BOARD, 'title' => str_replace('&', '&', $board['name']), @@ -898,11 +898,11 @@ class SMF2xExporter extends AbstractExporter { 'message' => self::fixBBCodes($row['body']), 'time' => $row['poster_time'], 'isDisabled' => $row['approved'] ? 0 : 1, - 'editorID' => ($row['editorID'] ?: null), + 'editorID' => $row['editorID'] ?: null, 'editor' => $row['modified_name'], 'lastEditTime' => $row['modified_time'], 'editCount' => $row['modified_time'] ? 1 : 0, - 'editReason' => (!empty($row['editReason']) ? $row['editReason'] : ''), + 'editReason' => !empty($row['editReason']) ? $row['editReason'] : '', 'enableHtml' => 0, 'ipAddress' => UserUtil::convertIPv4To6($row['poster_ip']) ]); @@ -953,7 +953,7 @@ class SMF2xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.attachment')->import($row['id_attach'], [ 'objectID' => $row['id_msg'], - 'userID' => ($row['id_member'] ?: null), + 'userID' => $row['id_member'] ?: null, 'filename' => $row['filename'], 'filesize' => $row['size'], 'fileType' => $row['mime_type'], diff --git a/files/lib/system/exporter/VB3or4xExporter.class.php b/files/lib/system/exporter/VB3or4xExporter.class.php index 85004af..46592c3 100644 --- a/files/lib/system/exporter/VB3or4xExporter.class.php +++ b/files/lib/system/exporter/VB3or4xExporter.class.php @@ -936,7 +936,7 @@ class VB3or4xExporter extends AbstractExporter { 'hideConversation' => 0, // there is no trash 'isInvisible' => (isset($recipients['bcc']) && isset($recipients['bcc'][$row['userid']])) ? 1 : 0, 'lastVisitTime' => $row['messageread'] ? $row['dateline'] : 0 - ], ['labelIDs' => ($row['folderid'] > 0 ? [$row['userid'].'-'.$row['folderid']] : [])]); + ], ['labelIDs' => ($row['folderid'] > 0) ? [$row['userid'].'-'.$row['folderid']] : []]); } } @@ -991,9 +991,9 @@ class VB3or4xExporter extends AbstractExporter { }; foreach ($this->boardCache[$parentID] as $board) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['forumid'], [ - 'parentID' => ($board['parentid'] != -1 ? $board['parentid'] : null), + 'parentID' => $board['parentid'] != -1 ? $board['parentid'] : null, 'position' => $board['displayorder'], - 'boardType' => ($board['link'] ? Board::TYPE_LINK : ($board['options'] & self::FORUMOPTIONS_CANCONTAINTHREADS ? Board::TYPE_BOARD : Board::TYPE_CATEGORY)), + 'boardType' => $board['link'] ? Board::TYPE_LINK : ($board['options'] & self::FORUMOPTIONS_CANCONTAINTHREADS ? Board::TYPE_BOARD : Board::TYPE_CATEGORY), 'title' => StringUtil::decodeHTML($board['title_clean']), 'description' => StringUtil::decodeHTML($board['description_clean']), 'descriptionUseHtml' => 0, @@ -1054,7 +1054,7 @@ class VB3or4xExporter extends AbstractExporter { 'isDisabled' => $row['visible'] == 1 ? 0 : 1, // visible = 2 is deleted 'isClosed' => $row['open'] == 1 ? 0 : 1, // open = 10 is redirect 'isDeleted' => $row['visible'] == 2 ? 1 : 0, - 'movedThreadID' => ($row['open'] == 10 && $row['pollid'] ? $row['pollid'] : null), // target thread is saved in pollid... + 'movedThreadID' => ($row['open'] == 10 && $row['pollid']) ? $row['pollid'] : null, // target thread is saved in pollid... 'movedTime' => 0, 'isDone' => 0, 'deleteTime' => $row['deleteTime'] ?: 0, @@ -1119,13 +1119,13 @@ class VB3or4xExporter extends AbstractExporter { 'isDeleted' => $row['visible'] == 2 ? 1 : 0, 'isDisabled' => $row['visible'] == 0 ? 1 : 0, 'isClosed' => 0, - 'editorID' => ($row['editorID'] ?: null), + 'editorID' => $row['editorID'] ?: null, 'editor' => $row['editor'] ?: '', 'lastEditTime' => $row['lastEditTime'] ?: 0, - 'editCount' => ($row['editCount'] && $row['editCount'] > 0 ? $row['editCount'] : 0), + 'editCount' => $row['editCount'] && $row['editCount'] > 0 ? $row['editCount'] : 0, 'editReason' => $row['editReason'] ?: '', 'attachments' => $row['attach'], - 'enableHtml' => (isset($row['htmlState']) && $row['htmlState'] != 'off' ? 1 : 0), + 'enableHtml' => isset($row['htmlState']) && $row['htmlState'] != 'off' ? 1 : 0, 'ipAddress' => UserUtil::convertIPv4To6($row['ipaddress']) ]); } @@ -1216,16 +1216,16 @@ class VB3or4xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.attachment')->import($row['attachmentid'], [ 'objectID' => $row['postid'], - 'userID' => ($row['userid'] ?: null), + 'userID' => $row['userid'] ?: null, 'filename' => $row['filename'], - 'filesize' => (isset($row['filesize']) ? $row['filesize'] : filesize($file)), + 'filesize' => isset($row['filesize']) ? $row['filesize'] : filesize($file), 'fileType' => FileUtil::getMimeType($file), 'isImage' => $row['isImage'], 'width' => $row['width'], 'height' => $row['height'], 'downloads' => $row['counter'], 'uploadTime' => $row['dateline'], - 'showOrder' => (isset($row['displayOrder']) ? $row['displayOrder'] : 0) + 'showOrder' => isset($row['displayOrder']) ? $row['displayOrder'] : 0 ], ['fileLocation' => $file]); if ($this->readOption('attachfile') == self::ATTACHFILE_DATABASE) unlink($file); @@ -1397,9 +1397,9 @@ class VB3or4xExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.like')->import(0, [ 'objectID' => $row['postid'], - 'objectUserID' => ($row['userid'] ?: null), + 'objectUserID' => $row['userid'] ?: null, 'userID' => $row['whoadded'], - 'likeValue' => ($row['reputation'] > 0 ? Like::LIKE : Like::DISLIKE), + 'likeValue' => ($row['reputation'] > 0) ? Like::LIKE : Like::DISLIKE, 'time' => $row['dateline'] ]); } @@ -1720,9 +1720,9 @@ class VB3or4xExporter extends AbstractExporter { ]; ImportHandler::getInstance()->getImporter('com.woltlab.gallery.image')->import((isset($row['pictureid']) ? $row['pictureid'] : $row['filedataid']), [ - 'userID' => ($row['userid'] ?: null), + 'userID' => $row['userid'] ?: null, 'username' => StringUtil::decodeHTML($row['username'] ?: ''), - 'albumID' => ($row['albumid'] ?: null), + 'albumID' => $row['albumid'] ?: null, 'title' => StringUtil::decodeHTML($row['caption']), 'description' => '', 'filename' => StringUtil::decodeHTML(isset($row['filename']) ? $row['filename'] : ''), @@ -1767,8 +1767,8 @@ class VB3or4xExporter extends AbstractExporter { $statement->execute([$offset + 1, $offset + $limit]); while ($row = $statement->fetchArray()) { ImportHandler::getInstance()->getImporter('com.woltlab.gallery.image.comment')->import($row['commentid'], [ - 'objectID' => (isset($row['pictureid']) ? $row['pictureid'] : $row['filedataid']), - 'userID' => ($row['postuserid'] ?: null), + 'objectID' => isset($row['pictureid']) ? $row['pictureid'] : $row['filedataid'], + 'userID' => $row['postuserid'] ?: null, 'username' => StringUtil::decodeHTML($row['username'] ?: ''), 'message' => $row['pagetext'], 'time' => $row['dateline'] @@ -1921,7 +1921,7 @@ class VB3or4xExporter extends AbstractExporter { } $data = [ - 'userID' => ($row['userid'] ?: null), + 'userID' => $row['userid'] ?: null, 'username' => $row['username'], 'subject' => $row['title'], 'message' => self::fixBBCodes($row['event']), diff --git a/files/lib/system/exporter/VB5xExporter.class.php b/files/lib/system/exporter/VB5xExporter.class.php index 3ea1a2a..ded2ffe 100644 --- a/files/lib/system/exporter/VB5xExporter.class.php +++ b/files/lib/system/exporter/VB5xExporter.class.php @@ -421,7 +421,7 @@ class VB5xExporter extends AbstractExporter { foreach ($this->boardCache[$parentID] as $board) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['nodeid'], [ - 'parentID' => ($board['parentid'] ?: null), + 'parentID' => $board['parentid'] ?: null, 'position' => $board['displayorder'] ?: 0, 'boardType' => Board::TYPE_BOARD, 'title' => $board['title'], @@ -531,7 +531,7 @@ class VB5xExporter extends AbstractExporter { 'lastEditTime' => 0, 'editCount' => 0, 'editReason' => '', - 'enableHtml' => (isset($row['htmlState']) && $row['htmlState'] != 'off' ? 1 : 0), + 'enableHtml' => (isset($row['htmlState']) && $row['htmlState'] != 'off') ? 1 : 0, 'ipAddress' => UserUtil::convertIPv4To6($row['ipaddress']) ]); } @@ -601,16 +601,16 @@ class VB5xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.attachment')->import($row['nodeid'], [ 'objectID' => $row['parentid'], - 'userID' => ($row['userid'] ?: null), + 'userID' => $row['userid'] ?: null, 'filename' => $row['filename'], - 'filesize' => (isset($row['filesize']) ? $row['filesize'] : filesize($file)), + 'filesize' => isset($row['filesize']) ? $row['filesize'] : filesize($file), 'fileType' => FileUtil::getMimeType($file), 'isImage' => $row['isImage'], 'width' => $row['width'], 'height' => $row['height'], 'downloads' => $row['counter'], 'uploadTime' => $row['dateline'], - 'showOrder' => (isset($row['displayOrder']) ? $row['displayOrder'] : 0) + 'showOrder' => isset($row['displayOrder']) ? $row['displayOrder'] : 0 ], ['fileLocation' => $file]); if ($this->readOption('attachfile') == self::ATTACHFILE_DATABASE) unlink($file); diff --git a/files/lib/system/exporter/WBB2xExporter.class.php b/files/lib/system/exporter/WBB2xExporter.class.php index 66a4bbf..5e0c976 100644 --- a/files/lib/system/exporter/WBB2xExporter.class.php +++ b/files/lib/system/exporter/WBB2xExporter.class.php @@ -289,17 +289,17 @@ class WBB2xExporter extends AbstractExporter { 'disableSignature' => $row['disablesignature'], 'banned' => $row['blocked'], 'signatureEnableHtml' => $row['allowsightml'], - 'registrationIpAddress' => (!empty($row['reg_ipaddress']) ? $row['reg_ipaddress'] : '') + 'registrationIpAddress' => !empty($row['reg_ipaddress']) ? $row['reg_ipaddress'] : '' ]; $options = [ 'birthday' => $row['birthday'], 'gender' => $row['gender'], 'homepage' => $row['homepage'], - 'icq' => ($row['icq'] ? $row['icq'] : ''), - 'location' => (!empty($row['field1']) ? $row['field1'] : ''), - 'hobbies' => (!empty($row['field2']) ? $row['field2'] : ''), - 'occupation' => (!empty($row['field3']) ? $row['field3'] : ''), + 'icq' => $row['icq'] ? $row['icq'] : '', + 'location' => !empty($row['field1']) ? $row['field1'] : '', + 'hobbies' => !empty($row['field2']) ? $row['field2'] : '', + 'occupation' => !empty($row['field3']) ? $row['field3'] : '', ]; foreach ($profileFields as $profileFieldID) { @@ -441,7 +441,7 @@ class WBB2xExporter extends AbstractExporter { 'categoryName' => 'profile.personal', 'optionType' => $optionType, 'required' => $row['required'], - 'visible' => ($row['hidden'] ? 0 : UserOption::VISIBILITY_ALL), + 'visible' => $row['hidden'] ? 0 : UserOption::VISIBILITY_ALL, 'showOrder' => $row['fieldorder'], 'selectOptions' => $row['fieldoptions'], 'editable' => UserOption::EDITABILITY_ALL @@ -508,14 +508,14 @@ class WBB2xExporter extends AbstractExporter { 'subject' => $row['subject'], 'time' => $row['sendtime'], 'userID' => $row['senderid'], - 'username' => ($row['username'] ?: '') + 'username' => $row['username'] ?: '' ]); // import message ImportHandler::getInstance()->getImporter('com.woltlab.wcf.conversation.message')->import($row['privatemessageid'], [ 'conversationID' => $row['privatemessageid'], 'userID' => $row['senderid'], - 'username' => ($row['username'] ?: ''), + 'username' => $row['username'] ?: '', 'message' => self::fixBBCodes($row['message']), 'time' => $row['sendtime'], 'attachments' => $row['attachments'], @@ -556,7 +556,7 @@ class WBB2xExporter extends AbstractExporter { 'hideConversation' => $row['deletepm'], 'isInvisible' => $row['blindcopy'], 'lastVisitTime' => $row['view'] - ], ['labelIDs' => ($row['folderid'] ? [$row['folderid']] : [])]); + ], ['labelIDs' => $row['folderid'] ? [$row['folderid']] : []]); } } @@ -618,9 +618,9 @@ class WBB2xExporter extends AbstractExporter { foreach ($this->boardCache[$parentID] as $board) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['boardid'], [ - 'parentID' => ($board['parentid'] ?: null), + 'parentID' => $board['parentid'] ?: null, 'position' => $board['boardorder'], - 'boardType' => (!$board['isboard'] ? 1 : (!empty($board['externalurl']) ? 2 : 0)), + 'boardType' => !$board['isboard'] ? 1 : (!empty($board['externalurl']) ? 2 : 0), 'title' => $board['title'], 'description' => $board['description'], 'externalURL' => $board['externalurl'], @@ -738,7 +738,7 @@ class WBB2xExporter extends AbstractExporter { 'isSticky' => intval($row['important'] == 1), 'isDisabled' => intval(!$row['visible']), 'isClosed' => intval($row['closed'] == 1), - 'movedThreadID' => ($row['closed'] == 3 ? $row['pollid'] : null), + 'movedThreadID' => ($row['closed'] == 3) ? $row['pollid'] : null, 'lastPostTime' => $row['lastposttime'] ]; $additionalData = []; @@ -778,7 +778,7 @@ class WBB2xExporter extends AbstractExporter { 'message' => self::fixBBCodes($row['message']), 'time' => $row['posttime'], 'isDisabled' => intval(!$row['visible']), - 'editorID' => ($row['editorid'] ?: null), + 'editorID' => $row['editorid'] ?: null, 'editor' => $row['editor'], 'lastEditTime' => $row['edittime'], 'editCount' => $row['editcount'], @@ -893,7 +893,7 @@ class WBB2xExporter extends AbstractExporter { 'objectID' => $postID, 'question' => $row['question'], 'time' => $row['starttime'], - 'endTime' => ($row['timeout'] ? $row['starttime'] + $row['timeout'] * 86400 : 0), + 'endTime' => $row['timeout'] ? $row['starttime'] + $row['timeout'] * 86400 : 0, 'maxVotes' => $row['choicecount'], 'votes' => $votes ]); @@ -1148,7 +1148,7 @@ class WBB2xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter($objectType)->import($row['attachmentid'], [ 'objectID' => $row[$indexName], - 'userID' => ($row['userid'] ?: null), + 'userID' => $row['userid'] ?: null, 'filename' => $row['attachmentname'].'.'.$row['attachmentextension'], 'filesize' => $row['attachmentsize'], 'fileType' => $fileType, diff --git a/files/lib/system/exporter/WBB3xExporter.class.php b/files/lib/system/exporter/WBB3xExporter.class.php index e24d9e4..cf2c083 100644 --- a/files/lib/system/exporter/WBB3xExporter.class.php +++ b/files/lib/system/exporter/WBB3xExporter.class.php @@ -327,8 +327,8 @@ class WBB3xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.user.group')->import($row['groupID'], [ 'groupName' => $row['groupName'], 'groupType' => $row['groupType'], - 'userOnlineMarking' => (!empty($row['userOnlineMarking']) ? $row['userOnlineMarking'] : ''), - 'showOnTeamPage' => (!empty($row['showOnTeamPage']) ? $row['showOnTeamPage'] : 0) + 'userOnlineMarking' => !empty($row['userOnlineMarking']) ? $row['userOnlineMarking'] : '', + 'showOnTeamPage' => !empty($row['showOnTeamPage']) ? $row['showOnTeamPage'] : 0 ]); } } @@ -431,8 +431,8 @@ class WBB3xExporter extends AbstractExporter { 'oldUsername' => $row['oldUsername'], 'registrationIpAddress' => UserUtil::convertIPv4To6($row['registrationIpAddress']), 'disableAvatar' => $row['disableAvatar'], - 'disableAvatarReason' => (!empty($row['disableAvatarReason']) ? $row['disableAvatarReason'] : ''), - 'enableGravatar' => ((!empty($row['gravatar']) && $row['gravatar'] == $row['email']) ? 1 : 0), + 'disableAvatarReason' => !empty($row['disableAvatarReason']) ? $row['disableAvatarReason'] : '', + 'enableGravatar' => (!empty($row['gravatar']) && $row['gravatar'] == $row['email']) ? 1 : 0, 'signature' => $row['signature'], 'signatureEnableHtml' => $row['enableSignatureHtml'], 'disableSignature' => $row['disableSignature'], @@ -526,7 +526,7 @@ class WBB3xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.user.follower')->import(0, [ 'userID' => $row['userID'], 'followUserID' => $row['whiteUserID'], - 'time' => (!empty($row['time']) ? $row['time'] : 0) + 'time' => !empty($row['time']) ? $row['time'] : 0 ]); } } @@ -754,13 +754,13 @@ class WBB3xExporter extends AbstractExporter { 'validationPattern' => $row['validationPattern'], 'selectOptions' => $row['selectOptions'], 'required' => $row['required'], - 'askDuringRegistration' => (!empty($row['askDuringRegistration']) ? 1 : 0), + 'askDuringRegistration' => !empty($row['askDuringRegistration']) ? 1 : 0, 'searchable' => $row['searchable'], 'isDisabled' => $row['disabled'], 'editable' => $editable, 'visible' => $visible, 'showOrder' => $row['showOrder'] - ], ['name' => ($row['name'] ?: $row['optionName'])]); + ], ['name' => $row['name'] ?: $row['optionName']]); } } @@ -957,7 +957,7 @@ class WBB3xExporter extends AbstractExporter { 'hideConversation' => $row['isDeleted'], 'isInvisible' => $row['isBlindCopy'], 'lastVisitTime' => $row['isViewed'] - ], ['labelIDs' => ($row['folderID'] ? [$row['folderID']] : [])]); + ], ['labelIDs' => $row['folderID'] ? [$row['folderID']] : []]); } } @@ -1023,8 +1023,8 @@ class WBB3xExporter extends AbstractExporter { if (!in_array($board['sortField'], self::$availableThreadSortFields)) $board['sortField'] = 'lastPostTime'; ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['boardID'], [ - 'parentID' => ($board['parentID'] ?: null), - 'position' => ($board['position'] ?: 0), + 'parentID' => $board['parentID'] ?: null, + 'position' => $board['position'] ?: 0, 'boardType' => $board['boardType'], 'title' => $board['title'], 'description' => $board['description'], @@ -1033,18 +1033,18 @@ class WBB3xExporter extends AbstractExporter { 'time' => $board['time'], 'countUserPosts' => $board['countUserPosts'], 'daysPrune' => $board['daysPrune'], - 'enableMarkingAsDone' => (!empty($board['enableMarkingAsDone']) ? $board['enableMarkingAsDone'] : 0), - 'ignorable' => (!empty($board['ignorable']) ? $board['ignorable'] : 0), + 'enableMarkingAsDone' => !empty($board['enableMarkingAsDone']) ? $board['enableMarkingAsDone'] : 0, + 'ignorable' => !empty($board['ignorable']) ? $board['ignorable'] : 0, 'isClosed' => $board['isClosed'], 'isInvisible' => $board['isInvisible'], - 'postSortOrder' => (!empty($board['postSortOrder']) ? $board['postSortOrder'] : ''), - 'postsPerPage' => (!empty($board['postsPerPage']) ? $board['postsPerPage'] : 0), - 'searchable' => (!empty($board['searchable']) ? $board['searchable'] : 0), - 'searchableForSimilarThreads' => (!empty($board['searchableForSimilarThreads']) ? $board['searchableForSimilarThreads'] : 0), + 'postSortOrder' => !empty($board['postSortOrder']) ? $board['postSortOrder'] : '', + 'postsPerPage' => !empty($board['postsPerPage']) ? $board['postsPerPage'] : 0, + 'searchable' => !empty($board['searchable']) ? $board['searchable'] : 0, + 'searchableForSimilarThreads' => !empty($board['searchableForSimilarThreads']) ? $board['searchableForSimilarThreads'] : 0, 'showSubBoards' => $board['showSubBoards'], 'sortField' => $board['sortField'], 'sortOrder' => $board['sortOrder'], - 'threadsPerPage' => (!empty($board['threadsPerPage']) ? $board['threadsPerPage'] : 0), + 'threadsPerPage' => !empty($board['threadsPerPage']) ? $board['threadsPerPage'] : 0, 'clicks' => $board['clicks'], 'posts' => $board['posts'], 'threads' => $board['threads'] @@ -1176,9 +1176,9 @@ class WBB3xExporter extends AbstractExporter { 'isDisabled' => $row['isDisabled'], 'isClosed' => $row['isClosed'], 'isDeleted' => $row['isDeleted'], - 'movedThreadID' => ($row['movedThreadID'] ?: null), - 'movedTime' => (!empty($row['movedTime']) ? $row['movedTime'] : 0), - 'isDone' => (!empty($row['isDone']) ? $row['isDone'] : 0), + 'movedThreadID' => $row['movedThreadID'] ?: null, + 'movedTime' => !empty($row['movedTime']) ? $row['movedTime'] : 0, + 'isDone' => !empty($row['isDone']) ? $row['isDone'] : 0, 'deleteTime' => $row['deleteTime'], 'lastPostTime' => $row['lastPostTime'] ]; @@ -1223,11 +1223,11 @@ class WBB3xExporter extends AbstractExporter { 'isDeleted' => $row['isDeleted'], 'isDisabled' => $row['isDisabled'], 'isClosed' => $row['isClosed'], - 'editorID' => ($row['editorID'] ?: null), + 'editorID' => $row['editorID'] ?: null, 'editor' => $row['editor'], 'lastEditTime' => $row['lastEditTime'], 'editCount' => $row['editCount'], - 'editReason' => (!empty($row['editReason']) ? $row['editReason'] : ''), + 'editReason' => !empty($row['editReason']) ? $row['editReason'] : '', 'attachments' => $row['attachments'], 'enableHtml' => $row['enableHtml'], 'ipAddress' => UserUtil::convertIPv4To6($row['ipAddress']), @@ -1319,9 +1319,9 @@ class WBB3xExporter extends AbstractExporter { 'objectID' => $row['messageID'], 'question' => $row['question'], 'time' => $row['time'], - 'endTime' => ($row['endTime'] > 2147483647 ? 2147483647 : $row['endTime']), - 'isChangeable' => ($row['votesNotChangeable'] ? 0 : 1), - 'isPublic' => (!empty($row['isPublic']) ? $row['isPublic'] : 0), + 'endTime' => $row['endTime'] > 2147483647 ? 2147483647 : $row['endTime'], + 'isChangeable' => $row['votesNotChangeable'] ? 0 : 1, + 'isPublic' => !empty($row['isPublic']) ? $row['isPublic'] : 0, 'sortByVotes' => $row['sortByResult'], 'maxVotes' => $row['choiceCount'], 'votes' => $row['votes'] @@ -1454,9 +1454,9 @@ class WBB3xExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.like')->import(0, [ 'objectID' => $row['firstPostID'], - 'objectUserID' => ($row['objectUserID'] ?: null), + 'objectUserID' => $row['objectUserID'] ?: null, 'userID' => $row['userID'], - 'likeValue' => ($row['rating'] > 3 ? Like::LIKE : Like::DISLIKE), + 'likeValue' => ($row['rating'] > 3) ? Like::LIKE : Like::DISLIKE, 'time' => $row['time'] ]); } @@ -1737,7 +1737,7 @@ class WBB3xExporter extends AbstractExporter { 'smileyTitle' => $row['smileyTitle'], 'smileyCode' => $row['smileyCode'], 'showOrder' => $row['showOrder'], - 'categoryID' => (!empty($row['smileyCategoryID']) ? $row['smileyCategoryID'] : null) + 'categoryID' => !empty($row['smileyCategoryID']) ? $row['smileyCategoryID'] : null ], ['fileLocation' => $fileLocation]); } } @@ -1876,7 +1876,7 @@ class WBB3xExporter extends AbstractExporter { if (isset($categories[$row['entryID']])) $additionalData['categories'] = $categories[$row['entryID']]; ImportHandler::getInstance()->getImporter('com.woltlab.blog.entry')->import($row['entryID'], [ - 'userID' => ($row['userID'] ?: null), + 'userID' => $row['userID'] ?: null, 'username' => $row['username'], 'subject' => $row['subject'], 'message' => self::fixBBCodes($row['message']), @@ -1974,9 +1974,9 @@ class WBB3xExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { ImportHandler::getInstance()->getImporter('com.woltlab.blog.entry.like')->import(0, [ 'objectID' => $row['objectID'], - 'objectUserID' => ($row['objectUserID'] ?: null), + 'objectUserID' => $row['objectUserID'] ?: null, 'userID' => $row['userID'], - 'likeValue' => ($row['rating'] > 3 ? Like::LIKE : Like::DISLIKE) + 'likeValue' => ($row['rating'] > 3) ? Like::LIKE : Like::DISLIKE ]); } } @@ -2041,7 +2041,7 @@ class WBB3xExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { $data = [ 'userID' => $row['ownerID'], - 'username' => ($row['username'] ?: ''), + 'username' => $row['username'] ?: '', 'title' => $row['title'], 'description' => $row['description'], 'lastUpdateTime' => $row['lastUpdateTime'] @@ -2119,9 +2119,9 @@ class WBB3xExporter extends AbstractExporter { if (isset($categories[$row['photoID']])) $additionalData['categories'] = array_unique($categories[$row['photoID']]); ImportHandler::getInstance()->getImporter('com.woltlab.gallery.image')->import($row['photoID'], [ - 'userID' => ($row['ownerID'] ?: null), + 'userID' => $row['ownerID'] ?: null, 'username' => $row['username'], - 'albumID' => ($row['albumID'] ?: null), + 'albumID' => $row['albumID'] ?: null, 'title' => $row['title'], 'description' => $row['description'], 'filename' => $row['filename'], @@ -2164,7 +2164,7 @@ class WBB3xExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { ImportHandler::getInstance()->getImporter('com.woltlab.gallery.image.comment')->import($row['commentID'], [ 'objectID' => $row['photoID'], - 'userID' => ($row['userID'] ?: null), + 'userID' => $row['userID'] ?: null, 'username' => $row['username'], 'message' => $row['comment'], 'time' => $row['time'] @@ -2207,9 +2207,9 @@ class WBB3xExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { ImportHandler::getInstance()->getImporter('com.woltlab.gallery.image.like')->import(0, [ 'objectID' => $row['objectID'], - 'objectUserID' => ($row['objectUserID'] ?: null), + 'objectUserID' => $row['objectUserID'] ?: null, 'userID' => $row['userID'], - 'likeValue' => ($row['rating'] > 3 ? Like::LIKE : Like::DISLIKE) + 'likeValue' => ($row['rating'] > 3) ? Like::LIKE : Like::DISLIKE ]); } } @@ -2352,9 +2352,9 @@ class WBB3xExporter extends AbstractExporter { 'endTime' => $oldEventDateData['endTime'], 'isFullDay' => $oldEventDateData['isFullDay'], 'timezone' => 'UTC', - 'firstDayOfWeek' => (isset($oldEventDateData['wkst']) ? $oldEventDateData['wkst'] : 1), + 'firstDayOfWeek' => isset($oldEventDateData['wkst']) ? $oldEventDateData['wkst'] : 1, 'repeatType' => $repeatType, - 'repeatInterval' => (isset($oldEventDateData['repeatInterval']) ? $oldEventDateData['repeatInterval'] : 1), + 'repeatInterval' => isset($oldEventDateData['repeatInterval']) ? $oldEventDateData['repeatInterval'] : 1, 'repeatWeeklyByDay' => $repeatWeeklyByDay, 'repeatMonthlyByMonthDay' => $repeatMonthlyByMonthDay, 'repeatMonthlyDayOffset' => $repeatMonthlyDayOffset, @@ -2369,7 +2369,7 @@ class WBB3xExporter extends AbstractExporter { ]; $data = [ - 'userID' => ($row['userID'] ?: null), + 'userID' => $row['userID'] ?: null, 'username' => $row['username'], 'location' => $row['location'], 'enableComments' => $row['enableComments'], @@ -2594,8 +2594,8 @@ class WBB3xExporter extends AbstractExporter { $fileLocation = $this->fileSystemPath.'attachments/attachment-'.$row['attachmentID']; ImportHandler::getInstance()->getImporter($objectType)->import($row['attachmentID'], [ - 'objectID' => (!empty($row['containerID']) ? $row['containerID'] : $row['messageID']), - 'userID' => ($row['userID'] ?: null), + 'objectID' => !empty($row['containerID']) ? $row['containerID'] : $row['messageID'], + 'userID' => $row['userID'] ?: null, 'filename' => $row['attachmentName'], 'filesize' => $row['attachmentSize'], 'fileType' => $row['fileType'], @@ -2603,7 +2603,7 @@ class WBB3xExporter extends AbstractExporter { 'downloads' => $row['downloads'], 'lastDownloadTime' => $row['lastDownloadTime'], 'uploadTime' => $row['uploadTime'], - 'showOrder' => (!empty($row['showOrder']) ? $row['showOrder'] : 0) + 'showOrder' => !empty($row['showOrder']) ? $row['showOrder'] : 0 ], ['fileLocation' => $fileLocation]); } } diff --git a/files/lib/system/exporter/WBB4xExporter.class.php b/files/lib/system/exporter/WBB4xExporter.class.php index c88b372..92f3d43 100644 --- a/files/lib/system/exporter/WBB4xExporter.class.php +++ b/files/lib/system/exporter/WBB4xExporter.class.php @@ -346,8 +346,8 @@ class WBB4xExporter extends AbstractExporter { 'groupDescription' => $row['groupDescription'], 'groupType' => $row['groupType'], 'priority' => $row['priority'], - 'userOnlineMarking' => (!empty($row['userOnlineMarking']) ? $row['userOnlineMarking'] : ''), - 'showOnTeamPage' => (!empty($row['showOnTeamPage']) ? $row['showOnTeamPage'] : 0) + 'userOnlineMarking' => !empty($row['userOnlineMarking']) ? $row['userOnlineMarking'] : '', + 'showOnTeamPage' => !empty($row['showOnTeamPage']) ? $row['showOnTeamPage'] : 0 ]); } } @@ -654,7 +654,7 @@ class WBB4xExporter extends AbstractExporter { 'editable' => $row['editable'], 'visible' => $row['visible'], 'showOrder' => $row['showOrder'] - ], ['name' => ($row['name'] ?: $row['optionName'])]); + ], ['name' => $row['name'] ?: $row['optionName']]); } } @@ -811,7 +811,7 @@ class WBB4xExporter extends AbstractExporter { 'hideConversation' => $row['hideConversation'], 'isInvisible' => $row['isInvisible'], 'lastVisitTime' => $row['lastVisitTime'] - ], ['labelIDs' => (isset($labels[$row['conversationID']][$row['participantID']]) ? $labels[$row['conversationID']][$row['participantID']] : [])]); + ], ['labelIDs' => isset($labels[$row['conversationID']][$row['participantID']]) ? $labels[$row['conversationID']][$row['participantID']] : []]); } } @@ -1298,7 +1298,7 @@ class WBB4xExporter extends AbstractExporter { // import label group ImportHandler::getInstance()->getImporter('com.woltlab.wcf.label.group')->import($labelGroup['groupID'], [ 'groupName' => $labelGroup['groupName'] - ], ['objects' => [$objectType->objectTypeID => (!empty($boardIDs[$labelGroup['groupID']]) ? $boardIDs[$labelGroup['groupID']] : [])]]); + ], ['objects' => [$objectType->objectTypeID => !empty($boardIDs[$labelGroup['groupID']]) ? $boardIDs[$labelGroup['groupID']] : []]]); // import labels if (!empty($labels[$labelGroup['groupID']])) { @@ -1689,7 +1689,7 @@ class WBB4xExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { $data = [ 'userID' => $row['userID'], - 'username' => ($row['username'] ?: ''), + 'username' => $row['username'] ?: '', 'title' => $row['title'], 'description' => $row['description'], 'lastUpdateTime' => $row['lastUpdateTime'] @@ -1833,7 +1833,7 @@ class WBB4xExporter extends AbstractExporter { foreach ($images as $imageID => $imageData) { $additionalData = [ - 'fileLocation' => $imageFilePath .'/userImages/' . substr($imageData['fileHash'], 0, 2) . '/' . ($imageID) . '-' . $imageData['fileHash'] . '.' . $imageData['fileExtension'] + 'fileLocation' => $imageFilePath .'/userImages/' . substr($imageData['fileHash'], 0, 2) . '/' . $imageID . '-' . $imageData['fileHash'] . '.' . $imageData['fileExtension'] ]; if (isset($categories[$imageID])) { @@ -2337,7 +2337,7 @@ class WBB4xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter($importer)->import($row['attachmentID'], [ 'objectID' => $row['objectID'], - 'userID' => ($row['userID'] ?: null), + 'userID' => $row['userID'] ?: null, 'filename' => $row['filename'], 'filesize' => $row['filesize'], 'fileType' => $row['fileType'], diff --git a/files/lib/system/exporter/WordPress3xExporter.class.php b/files/lib/system/exporter/WordPress3xExporter.class.php index ef82f55..3d6a026 100644 --- a/files/lib/system/exporter/WordPress3xExporter.class.php +++ b/files/lib/system/exporter/WordPress3xExporter.class.php @@ -288,15 +288,15 @@ class WordPress3xExporter extends AbstractExporter { if (!$time) $time = @strtotime($row['post_date']); ImportHandler::getInstance()->getImporter('com.woltlab.blog.entry')->import($row['ID'], [ - 'userID' => ($row['post_author'] ?: null), - 'username' => ($row['user_login'] ?: ''), + 'userID' => $row['post_author'] ?: null, + 'username' => $row['user_login'] ?: '', 'subject' => $row['post_title'], 'message' => self::fixMessage($row['post_content']), 'time' => $time, 'comments' => $row['comment_count'], 'enableHtml' => 1, - 'isPublished' => ($row['post_status'] == 'publish' ? 1 : 0), - 'isDeleted' => ($row['post_status'] == 'trash' ? 1 : 0) + 'isPublished' => ($row['post_status'] == 'publish') ? 1 : 0, + 'isDeleted' => ($row['post_status'] == 'trash') ? 1 : 0 ], $additionalData); } } @@ -336,7 +336,7 @@ class WordPress3xExporter extends AbstractExporter { if (!$row['comment_parent']) { ImportHandler::getInstance()->getImporter('com.woltlab.blog.entry.comment')->import($row['comment_ID'], [ 'objectID' => $row['comment_post_ID'], - 'userID' => ($row['user_id'] ?: null), + 'userID' => $row['user_id'] ?: null, 'username' => $row['comment_author'], 'message' => StringUtil::decodeHTML($row['comment_content']), 'time' => @strtotime($row['comment_date_gmt']) @@ -352,7 +352,7 @@ class WordPress3xExporter extends AbstractExporter { if (!$row2['comment_parent']) { ImportHandler::getInstance()->getImporter('com.woltlab.blog.entry.comment.response')->import($row['comment_ID'], [ 'commentID' => $row2['comment_ID'], - 'userID' => ($row['user_id'] ?: null), + 'userID' => $row['user_id'] ?: null, 'username' => $row['comment_author'], 'message' => StringUtil::decodeHTML($row['comment_content']), 'time' => @strtotime($row['comment_date_gmt']) @@ -418,7 +418,7 @@ class WordPress3xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.blog.entry.attachment')->import($row['meta_id'], [ 'objectID' => $row['post_parent'], - 'userID' => ($row['post_author'] ?: null), + 'userID' => $row['post_author'] ?: null, 'filename' => basename($fileLocation), 'filesize' => filesize($fileLocation), 'fileType' => $row['post_mime_type'], diff --git a/files/lib/system/exporter/XF12xExporter.class.php b/files/lib/system/exporter/XF12xExporter.class.php index 657236e..6ef27dc 100644 --- a/files/lib/system/exporter/XF12xExporter.class.php +++ b/files/lib/system/exporter/XF12xExporter.class.php @@ -235,7 +235,7 @@ class XF12xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wcf.user.group')->import($row['user_group_id'], [ 'groupName' => $row['title'], 'groupType' => UserGroup::OTHER, - 'userOnlineMarking' => ($row['username_css'] ? '%s' : '%s'), + 'userOnlineMarking' => $row['username_css'] ? '%s' : '%s', 'priority' => $row['display_style_priority'] ]); } @@ -762,10 +762,10 @@ class XF12xExporter extends AbstractExporter { 'conversationID' => $row['conversation_id'], 'participantID' => $row['user_id'], 'username' => $row['username'] ?: '', - 'hideConversation' => ($row['recipient_state'] == 'deleted_ignored' ? Conversation::STATE_LEFT : ($row['recipient_state'] == 'deleted' ? Conversation::STATE_HIDDEN : Conversation::STATE_DEFAULT)), + 'hideConversation' => $row['recipient_state'] == 'deleted_ignored' ? Conversation::STATE_LEFT : ($row['recipient_state'] == 'deleted' ? Conversation::STATE_HIDDEN : Conversation::STATE_DEFAULT), 'isInvisible' => 0, 'lastVisitTime' => $row['last_read_date'] - ], ['labelIDs' => ($row['is_starred'] ? [$row['user_id']] : [])]); + ], ['labelIDs' => $row['is_starred'] ? [$row['user_id']] : []]); } } @@ -802,9 +802,9 @@ class XF12xExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($row['nodeID'], [ - 'parentID' => ($row['parent_node_id'] ?: null), + 'parentID' => $row['parent_node_id'] ?: null, 'position' => $row['lft'], - 'boardType' => ($row['node_type_id'] == 'Category' ? Board::TYPE_CATEGORY : ($row['node_type_id'] == 'Forum' ? Board::TYPE_BOARD : Board::TYPE_LINK)), + 'boardType' => $row['node_type_id'] == 'Category' ? Board::TYPE_CATEGORY : ($row['node_type_id'] == 'Forum' ? Board::TYPE_BOARD : Board::TYPE_LINK), 'title' => $row['title'], 'description' => $row['description'], 'descriptionUseHtml' => 1, // cannot be disabled @@ -896,7 +896,7 @@ class XF12xExporter extends AbstractExporter { 'message' => self::fixBBCodes($row['message']), 'time' => $row['post_date'], 'isDisabled' => $row['message_state'] == 'moderated' ? 1 : 0, - 'editorID' => ($row['last_edit_user_id'] ?: null), + 'editorID' => $row['last_edit_user_id'] ?: null, 'editor' => $row['editor'] ?: '', 'lastEditTime' => $row['last_edit_date'], 'editCount' => $row['editor'] ? $row['edit_count'] : 0, @@ -1165,7 +1165,7 @@ class XF12xExporter extends AbstractExporter { foreach ($mapping[$row['permission_id']] as $permission) { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.acl')->import(0, [ 'objectID' => $row['content_id'], - ($row['user_id'] ? 'userID' : 'groupID') => $row['user_id'] ?: $row['user_group_id'], + $row['user_id'] ? 'userID' : 'groupID' => $row['user_id'] ?: $row['user_group_id'], 'optionValue' => $row['permission_value'] == 'content_allow' ? 1 : 0 ], [ 'optionName' => $permission @@ -1426,7 +1426,7 @@ class XF12xExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter($objectType)->import($row['attachment_id'], [ 'objectID' => $row['content_id'], - 'userID' => ($row['user_id'] ?: null), + 'userID' => $row['user_id'] ?: null, 'filename' => $row['filename'], 'filesize' => $row['file_size'], 'fileType' => FileUtil::getMimeType($fileLocation) ?: 'application/octet-stream', -- 2.20.1