diff --git a/e107_core/sql/core_sql.php b/e107_core/sql/core_sql.php
index fda85c6c5..80dbd0df2 100644
--- a/e107_core/sql/core_sql.php
+++ b/e107_core/sql/core_sql.php
@@ -300,9 +300,9 @@ CREATE TABLE menus (
CREATE TABLE news (
news_id int(10) unsigned NOT NULL auto_increment,
- news_title varchar(200) NOT NULL default '',
+ news_title varchar(255) NOT NULL default '',
news_sef varchar(200) NOT NULL default '',
- news_body text NOT NULL,
+ news_body longtext NOT NULL,
news_extended text NOT NULL,
news_meta_keywords varchar(255) NOT NULL default '',
news_meta_description text NOT NULL,
diff --git a/e107_plugins/import/providers/blogger_import_class.php b/e107_plugins/import/providers/blogger_import_class.php
index 02ad7d9cc..7033d2e67 100644
--- a/e107_plugins/import/providers/blogger_import_class.php
+++ b/e107_plugins/import/providers/blogger_import_class.php
@@ -26,10 +26,6 @@
// require_once('import_classes.php');
require_once('rss_import_class.php');
-//$import_class_names['blogger_import'] = 'Blogger';
-//$import_class_comment['blogger_import'] = 'Import up to 500 items from yourblog.blogspot.com';
-//$import_class_support['blogger_import'] = array('news');
-//$import_default_prefix['blogger_import'] = '';
class blogger_import extends rss_import
{
@@ -40,9 +36,7 @@ class blogger_import extends rss_import
public $cleanupHtml = false;
public $defaultClass = false;
-
-
-
+
/*
If the first 500 posts of your blog feed are here:
@@ -56,7 +50,13 @@ class blogger_import extends rss_import
function init()
{
$mes = e107::getMessage();
-
+
+ if(E107_DEBUG_LEVEL > 0)
+ {
+ $this->action = 'preview'; // changes default action to 'preview' method below. (for testing)
+ }
+
+
if(vartrue($_POST['bloggerUrl']))
{
$this->feedUrl = rtrim($_POST['bloggerUrl'],"/")."/feeds/posts/default?max-results=999&alt=rss";
@@ -65,20 +65,26 @@ class blogger_import extends rss_import
if(vartrue($_POST['bloggerCleanup']))
{
$this->cleanupHtml = true;
- }
-
+ }
+
$mes->addDebug("Blogger Feed:".$this->feedUrl);
+
+ if(!empty($_POST['preview']))
+ {
+ $this->preview();
+ return;
+ }
}
function config()
{
$var[0]['caption'] = "Blogger URL";
- $var[0]['html'] = "";
+ $var[0]['html'] = e107::getForm()->text('bloggerUrl', $_POST['bloggerUrl'],255, 'size=xxlarge'); // "";
$var[0]['help'] = "eg. http://blogname.blogspot.com";
$var[1]['caption'] = "Cleanup HTML in content";
- $var[1]['html'] = "";
+ $var[1]['html'] = e107::getForm()->checkbox('bloggerCleanup',1, $_POST['bloggerCleanup']); // "";
$var[1]['help'] = "Tick to enable";
return $var;
@@ -86,16 +92,55 @@ class blogger_import extends rss_import
function process($type,$source)
{
-
+
+ $tp = e107::getParser();
+
+ $allowedTags = array('html', 'body', 'a','img','table','tr', 'td', 'th', 'tbody', 'thead', 'colgroup', 'b',
+ 'i', 'pre','code', 'strong', 'u', 'em','ul', 'ol', 'li','img','h1','h2','h3','h4','h5','h6','p','iframe',
+ 'div','pre','section','article', 'blockquote','hgroup','aside','figure', 'video', 'span', 'br',
+ 'small', 'caption', 'noscript'
+ );
+
+ $allowedAttributes = array(
+ 'default' => array('id'),
+ 'img' => array('id', 'src', 'style', 'class', 'alt', 'title', 'width', 'height'),
+ 'a' => array('id', 'href', 'class', 'title', 'target'),
+ 'script' => array('type', 'src', 'language'),
+ 'iframe' => array('id', 'src', 'frameborder', 'class', 'width', 'height', 'style')
+ );
+
+ $tp->setAllowedTags($allowedTags);
+ $tp->setAllowedAttributes($allowedAttributes);
+
switch ($type)
{
case 'description':
$body = $source[$type][0];
- if($this->cleanupHtml == TRUE)
+
+ if($this->cleanupHtml == true)
{
- $body = preg_replace("/font-family: [\w]*;/i","", $body);
- $body = preg_replace('/class="[\w]*" /i',"", $body);
+ // $body = preg_replace("/font-family: [\w]*;/i","", $body);
+ // $body = preg_replace('/class="[\w]*" /i',"", $body);
$body = str_replace("
","
",$body);
+
+ $body = $tp->cleanHtml($body,false);
+
+ $patterns = array();
+ $patterns[0] = '/