Fixed ipb import issues
authorMarcel Werk <burntime@woltlab.com>
Mon, 7 Nov 2016 10:46:57 +0000 (11:46 +0100)
committerMarcel Werk <burntime@woltlab.com>
Mon, 7 Nov 2016 10:46:57 +0000 (11:46 +0100)
files/lib/system/exporter/IPB3xExporter.class.php
files/lib/system/exporter/IPB4xExporter.class.php

index 49499c4746bfd4e8107e9d2190257f98bf72e845..c3ef36c7e6b524621249e074ba079ff04a9de179 100644 (file)
@@ -1047,6 +1047,7 @@ class IPB3xExporter extends AbstractExporter {
                // <br /> to newline
                $string = str_ireplace('<br />', "\n", $string);
                $string = str_ireplace('<br>', "\n", $string);
+               $string = str_ireplace('</p>', "\n", $string);
                
                // decode html entities
                $string = StringUtil::decodeHTML($string);
@@ -1118,10 +1119,10 @@ class IPB3xExporter extends AbstractExporter {
                $string = str_ireplace('</li>', '', $string);
                
                // mails
-               $string = preg_replace('~<a.*?href=(?:"|\')mailto:([^"]*)(?:"|\')>(.*?)</a>~is', '[email=\'\\1\']\\2[/email]', $string);
+               $string = preg_replace('~<a.*?href=(?:"|\')mailto:([^"]*)(?:"|\').*?>(.*?)</a>~is', '[email=\'\\1\']\\2[/email]', $string);
                
                // urls
-               $string = preg_replace('~<a.*?href=(?:"|\')([^"\']*)(?:"|\')>(.*?)</a>~is', '[url=\'\\1\']\\2[/url]', $string);
+               $string = preg_replace('~<a.*?href=(?:"|\')([^"\']*)(?:"|\').*?>(.*?)</a>~is', '[url=\'\\1\']\\2[/url]', $string);
                
                // smileys
                $string = preg_replace('~<img src=\'[^\']+\' class=\'bbc_emoticon\' alt=\'([^\']+)\' ?/?>~is', '\\1', $string);
index 8dde9a764b7ac30462c66bab34d5bcf0b868ce08..39b93cb989892702afa4ceb7f10681fdcb1bf02e 100644 (file)
@@ -1152,8 +1152,8 @@ class IPB4xExporter extends AbstractExporter {
                $string = preg_replace('~<a.*?><img data-fileid="(\d+)".*?</a>~i', '[attach]\\1[/attach]', $string);
                
                // urls
-               $string = preg_replace('~<a.*?href=(?:"|\')mailto:([^"]*)(?:"|\')>(.*?)</a>~is', '[email=\'\\1\']\\2[/email]', $string);
-               $string = preg_replace('~<a.*?href=(?:"|\')([^"\']*)(?:"|\')>(.*?)</a>~is', '[url=\'\\1\']\\2[/url]', $string);
+               $string = preg_replace('~<a.*?href=(?:"|\')mailto:([^"]*)(?:"|\').*?>(.*?)</a>~is', '[email=\'\\1\']\\2[/email]', $string);
+               $string = preg_replace('~<a.*?href=(?:"|\')([^"\']*)(?:"|\').*?>(.*?)</a>~is', '[url=\'\\1\']\\2[/url]', $string);
                
                // quotes
                $string = preg_replace('~<blockquote[^>]*data-author="([^"]+)"[^>]*>(.*?)</blockquote>~is', "[quote='\\1']\\2[/quote]", $string);