From 79d5c70655240186b458e01716b093b118b81297 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 9 Jun 2016 21:58:38 +0200 Subject: [PATCH] Throw decodeHTML at Xobor source data --- .../system/exporter/XoborExporter.class.php | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/files/lib/system/exporter/XoborExporter.class.php b/files/lib/system/exporter/XoborExporter.class.php index 6251a20..0a6f3ed 100644 --- a/files/lib/system/exporter/XoborExporter.class.php +++ b/files/lib/system/exporter/XoborExporter.class.php @@ -117,7 +117,7 @@ class XoborExporter extends AbstractExporter { $statement->execute(array($offset + 1, $offset + $limit)); while ($row = $statement->fetchArray()) { $data = array( - 'username' => $row['name'], + 'username' => StringUtil::decodeHTML($row['name']), 'password' => '', 'email' => $row['mail'], 'registrationDate' => strtotime($row['reged']), @@ -169,7 +169,7 @@ class XoborExporter extends AbstractExporter { 'parentID' => ($board['zuid'] ?: null), 'position' => $board['sort'], 'boardType' => ($board['iscat'] ? Board::TYPE_CATEGORY : Board::TYPE_BOARD), - 'title' => $board['title'], + 'title' => StringUtil::decodeHTML($board['title']), 'description' => $board['text'] )); @@ -197,10 +197,10 @@ class XoborExporter extends AbstractExporter { while ($row = $statement->fetchArray()) { $data = array( 'boardID' => $row['forum'], - 'topic' => $row['title'], + 'topic' => StringUtil::decodeHTML($row['title']), 'time' => $row['created'], 'userID' => $row['userid'], - 'username' => $row['name'], + 'username' => StringUtil::decodeHTML($row['name']), 'views' => $row['hits'], 'isSticky' => $row['header'] ? 1 : 0 ); @@ -230,19 +230,26 @@ class XoborExporter extends AbstractExporter { ImportHandler::getInstance()->getImporter('com.woltlab.wbb.post')->import($row['id'], array( 'threadID' => $row['thread'], 'userID' => $row['userid'], - 'username' => $row['username'], - 'subject' => $row['title'], + 'username' => StringUtil::decodeHTML($row['username']), + 'subject' => StringUtil::decodeHTML($row['title']), 'message' => $row['text'], 'time' => strtotime($row['writetime']), 'editorID' => null, 'enableHtml' => 1, 'isClosed' => 1, - 'ipAddress' => UserUtil::convertIPv4To6($row['signature']) + 'ipAddress' => UserUtil::convertIPv4To6($row['useraddr']) )); } } private static function fixMessage($string) { - return $string; + $string = strtr($string, array( + '[center]' => '[align=center]', + '[/center]' => '[/align]', + '[big]' => '[size=18]', + '[/big]' => '[/size]' + )); + + return StringUtil::decodeHTML($string); } } -- 2.20.1