Throw decodeHTML at Xobor source data
authorTim Düsterhus <tim@bastelstu.be>
Thu, 9 Jun 2016 19:58:38 +0000 (21:58 +0200)
committerTim Düsterhus <tim@bastelstu.be>
Wed, 10 Jul 2019 10:11:41 +0000 (12:11 +0200)
files/lib/system/exporter/XoborExporter.class.php

index 6251a2038d9beeb449b1bb3de4f29547288a1ada..0a6f3edfd10f6a832d97e84b8b8425c383ab0235 100644 (file)
@@ -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);
        }
 }