Index: locales/_pot/plugins.pot
===================================================================
--- locales/_pot/plugins.pot	(revision 2417)
+++ locales/_pot/plugins.pot	(revision 2485)
@@ -8,5 +8,5 @@
 "Project-Id-Version: Dotclear 2\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-17 09:38+0200\n"
+"POT-Creation-Date: 2013-10-23 13:44+0000\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
@@ -1535,9 +1535,15 @@
 msgstr ""
 
-#: plugins/importExport/inc/flat/class.flat.import.php:222
+#: plugins/importExport/inc/flat/class.flat.import.php:218
+#: plugins/importExport/inc/flat/class.flat.import.php:301
+#, php-format
+msgid "Error raised at line %s"
+msgstr ""
+
+#: plugins/importExport/inc/flat/class.flat.import.php:227
 msgid "File is not a full export."
 msgstr ""
 
-#: plugins/importExport/inc/flat/class.flat.import.php:704
+#: plugins/importExport/inc/flat/class.flat.import.php:711
 #, php-format
 msgid "ID of \"%3$s\" does not match on record \"%1$s\" at line %2$s of backup file."
@@ -1561,15 +1567,7 @@
 msgstr ""
 
-#: plugins/importExport/index.php:105
+#: plugins/importExport/index.php:104
 #, php-format
 msgid "Export functions are in the page %s."
-msgstr ""
-
-#: plugins/importExport/index.php:106 plugins/maintenance/_admin.php:16
-#: plugins/maintenance/_admin.php:83 plugins/maintenance/_admin.php:179
-#: plugins/maintenance/_admin.php:201 plugins/maintenance/index.php:113
-#: plugins/maintenance/index.php:137 plugins/maintenance/index.php:153
-#: plugins/maintenance/index.php:186
-msgid "Maintenance"
 msgstr ""
 
Index: locales/fr/plugins.po
===================================================================
--- locales/fr/plugins.po	(revision 2418)
+++ locales/fr/plugins.po	(revision 2485)
@@ -11,5 +11,5 @@
 "Project-Id-Version: Dotclear\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-10-17 09:38+0200\n"
+"POT-Creation-Date: 2013-10-23 13:44+0000\n"
 "PO-Revision-Date: 2012-11-06 10:04+0100\n"
 "Last-Translator: Franck Paul <carnet.franck.paul@gmail.com>\n"
@@ -1068,4 +1068,8 @@
 msgstr "Ce fichier n'est pas une exportation d'un blog."
 
+#, php-format
+msgid "Error raised at line %s"
+msgstr "Erreur détectée ligne %s"
+
 msgid "File is not a full export."
 msgstr "Ce fichier n'est pas un fichier de sauvegarde complet."
Index: plugins/importExport/inc/class.dc.import.flat.php
===================================================================
--- plugins/importExport/inc/class.dc.import.flat.php	(revision 1559)
+++ plugins/importExport/inc/class.dc.import.flat.php	(revision 2485)
@@ -15,5 +15,5 @@
 {
 	protected $status = false;
-	
+
 	public function setInfo()
 	{
@@ -22,5 +22,5 @@
 		$this->description = __('Imports a blog or a full Dotclear installation from flat file.');
 	}
-	
+
 	public function process($do)
 	{
@@ -29,7 +29,7 @@
 			return;
 		}
-		
+
 		$to_unlink = false;
-		
+
 		# Single blog import
 		$files = $this->getPublicFiles();
@@ -40,5 +40,5 @@
 			$single_upl = true;
 		}
-		
+
 		if ($single_upl !== null)
 		{
@@ -53,5 +53,5 @@
 				$file = $_POST['public_single_file'];
 			}
-			
+
 			try {
 				# Try to unzip file
@@ -64,5 +64,5 @@
 					$bk = new flatImport($this->core,$file);
 				}
-				
+
 				$bk->importSingle();
 			} catch (Exception $e) {
@@ -79,5 +79,5 @@
 			http::redirect($this->getURL().'&do=single');
 		}
-		
+
 		# Full import
 		$full_upl = null;
@@ -87,5 +87,5 @@
 			$full_upl = true;
 		}
-		
+
 		if ($full_upl !== null && $this->core->auth->isSuperAdmin())
 		{
@@ -93,5 +93,5 @@
 				throw new Exception(__('Password verification failed'));
 			}
-			
+
 			if ($full_upl) {
 				files::uploadStatus($_FILES['up_full_file']);
@@ -104,5 +104,5 @@
 				$file = $_POST['public_full_file'];
 			}
-			
+
 			try {
 				# Try to unzip file
@@ -115,5 +115,5 @@
 					$bk = new flatImport($this->core,$file);
 				}
-				
+
 				$bk->importFull();
 			} catch (Exception $e) {
@@ -130,12 +130,12 @@
 			http::redirect($this->getURL().'&do=full');
 		}
-		
+
 		header('content-type:text/plain');
 		var_dump($_POST);
 		exit;
-		
+
 		$this->status = true;
 	}
-	
+
 	public function gui()
 	{
@@ -150,8 +150,8 @@
 			return;
 		}
-		
+
 		$public_files = array_merge(array('-' => ''),$this->getPublicFiles());
 		$has_files = (boolean) (count($public_files) - 1);
-		
+
 		echo
 		'<script type="text/javascript">'."\n".
@@ -178,23 +178,23 @@
 		"//]]>\n".
 		"</script>\n";
-		
+
 		echo
 		'<form action="'.$this->getURL(true).'" method="post" enctype="multipart/form-data" class="fieldset">'.
 		'<h3>'.__('Single blog').'</h3>'.
 		'<p>'.sprintf(__('This will import a single blog backup as new content in the current blog: <strong>%s</strong>.'),html::escapeHTML($this->core->blog->name)).'</p>'.
-		
+
 		'<p><label for="up_single_file">'.__('Upload a backup file').
 		' ('.sprintf(__('maximum size %s'),files::size(DC_MAX_UPLOAD_SIZE)).')'.' </label>'.
 		' <input type="file" id="up_single_file" name="up_single_file" size="20" />'.
 		'</p>';
-		
+
 		if ($has_files) {
-			echo 
+			echo
 			'<p><label for="public_single_file" class="">'.__('or pick up a local file in your public directory').' </label> '.
 			form::combo('public_single_file',$public_files).
 			'</p>';
 		}
-		
-		echo 
+
+		echo
 		'<p>'.
 		$this->core->formNonce().
@@ -202,7 +202,7 @@
 		form::hidden(array('MAX_FILE_SIZE'),DC_MAX_UPLOAD_SIZE).
 		'<input type="submit" value="'.__('Import').'" /></p>'.
-		
+
 		'</form>';
-		
+
 		if ($this->core->auth->isSuperAdmin())
 		{
@@ -211,21 +211,21 @@
 			'<h3>'.__('Multiple blogs').'</h3>'.
 			'<p class="warning">'.__('This will reset all the content of your database, except users.').'</p>'.
-			
+
 			'<p><label for="up_full_file">'.__('Upload a backup file').' '.
 			' ('.sprintf(__('maximum size %s'),files::size(DC_MAX_UPLOAD_SIZE)).')'.' </label>'.
 			'<input type="file" id="up_full_file" name="up_full_file" size="20" />'.
 			'</p>';
-			
+
 			if ($has_files) {
-				echo 
+				echo
 				'<p><label for="public_full_file">'.__('or pick up a local file in your public directory').' </label>'.
 				form::combo('public_full_file',$public_files).
 				'</p>';
 			}
-			
+
 			echo
 			'<p><label for="your_pwd" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label>'.
 			form::password('your_pwd',20,255).'</p>'.
-			
+
 			'<p>'.
 			$this->core->formNonce().
@@ -233,9 +233,9 @@
 			form::hidden(array('MAX_FILE_SIZE'),DC_MAX_UPLOAD_SIZE).
 			'<input type="submit" value="'.__('Import').'" /></p>'.
-			
+
 			'</form>';
 		}
 	}
-	
+
 	protected function getPublicFiles()
 	{
@@ -246,5 +246,5 @@
 			while (($entry = $dir->read()) !== false) {
 				$entry_path = $dir->path.'/'.$entry;
-				
+
 				if (is_file($entry_path) && is_readable($entry_path))
 				{
@@ -261,25 +261,25 @@
 		return $public_files;
 	}
-	
+
 	protected static function checkFileContent($entry_path)
 	{
 		$ret = false;
-		
+
 		$fp = fopen($entry_path,'rb');
 		$ret = strpos(fgets($fp),'///DOTCLEAR|') === 0;
 		fclose($fp);
-		
+
 		return $ret;
 	}
-	
+
 	private function unzip($file)
 	{
 		$zip = new fileUnzip($file);
-		
+
 		if ($zip->isEmpty()) {
 			$zip->close();
 			return false;//throw new Exception(__('File is empty or not a compressed file.'));
 		}
-		
+
 		foreach($zip->getFilesList() as $zip_file)
 		{
@@ -288,5 +288,5 @@
 				continue;
 			}
-			
+
 			# Check zipped file contents
 			$content = $zip->unzip($zip_file);
@@ -295,7 +295,7 @@
 				continue;
 			}
-			
+
 			$target = path::fullFromRoot($zip_file,dirname($file));
-			
+
 			# Check existing files with same name
 			if (file_exists($target)) {
@@ -304,5 +304,5 @@
 				throw new Exception(__('Another file with same name exists.'));
 			}
-			
+
 			# Extract backup content
 			if (file_put_contents($target,$content) === false) {
@@ -311,15 +311,14 @@
 				throw new Exception(__('Failed to extract backup file.'));
 			}
-			
+
 			$zip->close();
 			unset($content);
-			
+
 			# Return extracted file name
 			return $target;
 		}
-		
+
 		$zip->close();
 		throw new Exception(__('No backup in compressed file.'));
 	}
 }
-?>
Index: plugins/importExport/inc/flat/class.flat.import.php
===================================================================
--- plugins/importExport/inc/flat/class.flat.import.php	(revision 1743)
+++ plugins/importExport/inc/flat/class.flat.import.php	(revision 2485)
@@ -17,15 +17,15 @@
 	private $con;
 	private $prefix;
-	
+
 	private $dc_version;
 	private $dc_major;
 	private $mode;
-	
+
 	private $blog_url;
 	private $blog_name;
 	private $blog_desc;
-	
+
 	private $users = array();
-	
+
 	public $old_ids = array(
 		'category' => array(),
@@ -33,5 +33,5 @@
 		'media' => array()
 	);
-	
+
 	public $stack = array(
 		'categories'=>null,
@@ -41,31 +41,32 @@
 		'media_id'=>1,
 		'comment_id'=>1,
-		'link_id'=>1
+		'link_id'=>1,
+		'log_id' => 1
 	);
-	
+
 	public $has_categories = false;
-	
+
 	public function __construct($core,$file)
 	{
 		parent::__construct($file);
-		
+
 		$first_line = fgets($this->fp);
 		if (strpos($first_line,'///DOTCLEAR|') !== 0) {
 			throw new Exception(__('File is not a DotClear backup.'));
 		}
-		
+
 		@set_time_limit(300);
-		
+
 		$l = explode('|',$first_line);
-		
+
 		if (isset($l[1])) {
 			$this->dc_version = $l[1];
 		}
-		
+
 		$this->mode = isset($l[2]) ? strtolower(trim($l[2])) : 'single';
 		if ($this->mode != 'full' && $this->mode != 'single') {
 			$this->mode = 'single';
 		}
-		
+
 		if (version_compare('1.2',$this->dc_version,'<=') &&
 		version_compare('1.3',$this->dc_version,'>')) {
@@ -74,9 +75,9 @@
 			$this->dc_major_version = '2.0';
 		}
-		
+
 		$this->core =& $core;
 		$this->con =& $core->con;
 		$this->prefix = $core->prefix;
-		
+
 		$this->cur_blog        = $this->con->openCursor($this->prefix.'blog');
 		$this->cur_category    = $this->con->openCursor($this->prefix.'category');
@@ -95,9 +96,9 @@
 		$this->cur_spamrule    = $this->con->openCursor($this->prefix.'spamrule');
 		$this->cur_version     = $this->con->openCursor($this->prefix.'version');
-		
+
 		# --BEHAVIOR-- importInit
 		$this->core->callBehavior('importInit',$this,$this->core);
 	}
-	
+
 	public function importSingle()
 	{
@@ -105,11 +106,11 @@
 			throw new Exception(__('File is not a single blog export.'));
 		}
-		
+
 		if (!$this->core->auth->check('admin',$this->core->blog->id)) {
 			throw new Exception(__('Permission denied.'));
 		}
-		
+
 		$this->blog_id = $this->core->blog->id;
-		
+
 		$this->stack['categories'] = $this->con->select(
 			'SELECT cat_id, cat_title, cat_url '.
@@ -117,37 +118,40 @@
 			"WHERE blog_id = '".$this->con->escape($this->blog_id)."' "
 		);
-		
+
 		$rs = $this->con->select('SELECT MAX(cat_id) FROM '.$this->prefix.'category');
 		$this->stack['cat_id'] = ((integer) $rs->f(0))+1;
-		
+
 		$rs = $this->con->select('SELECT MAX(link_id) FROM '.$this->prefix.'link');
 		$this->stack['link_id'] = ((integer) $rs->f(0))+1;
-		
+
 		$rs = $this->con->select('SELECT MAX(post_id) FROM '.$this->prefix.'post');
 		$this->stack['post_id'] = ((integer) $rs->f(0))+1;
-		
+
 		$rs = $this->con->select('SELECT MAX(media_id) FROM '.$this->prefix.'media');
 		$this->stack['media_id'] = ((integer) $rs->f(0))+1;
-		
+
 		$rs = $this->con->select('SELECT MAX(comment_id) FROM '.$this->prefix.'comment');
 		$this->stack['comment_id'] = ((integer) $rs->f(0))+1;
-		
+
+		$rs = $this->con->select('SELECT MAX(log_id) FROM '.$this->prefix.'log');
+		$this->stack['log_id'] = ((integer) $rs->f(0))+1;
+
 		$rs = $this->con->select(
 			'SELECT MAX(cat_rgt) AS cat_rgt FROM '.$this->prefix.'category '.
 			"WHERE blog_id = '".$this->con->escape($this->core->blog->id)."'"
 		);
-		
+
 		if ((integer) $rs->cat_rgt > 0) {
 			$this->has_categories = true;
 			$this->stack['cat_lft'][$this->core->blog->id] = (integer) $rs->cat_rgt + 1;
 		}
-		
+
 		$this->con->begin();
-		
+
 		try
 		{
 			$last_line_name = '';
 			$constrained = array('post', 'meta', 'post_media', 'ping', 'comment');
-			
+
 			while (($line = $this->getLine()) !== false)
 			{
@@ -156,5 +160,5 @@
 					$this->prepareDC12line($line);
 				}
-				
+
 				if ($last_line_name != $line->__name) {
 					if (in_array($last_line_name,$constrained)) {
@@ -163,5 +167,5 @@
 						if ($this->con->driver() == 'pgsql') $this->con->execute('SET CONSTRAINTS ALL DEFERRED');
 					}
-					
+
 					if (in_array($line->__name,$constrained)) {
 						# DEFER
@@ -169,8 +173,8 @@
 						if ($this->con->driver() == 'pgsql') $this->con->execute('SET CONSTRAINTS ALL IMMEDIATE');
 					}
-					
+
 					$last_line_name = $line->__name;
 				}
-				
+
 				switch ($line->__name)
 				{
@@ -200,9 +204,9 @@
 						break;
 				}
-				
+
 				# --BEHAVIOR-- importSingle
 				$this->core->callBehavior('importSingle',$line,$this,$this->core);
 			}
-			
+
 			if ($this->con->driver() == 'mysql' || $this->con->driver() == 'mysqli') $this->con->execute('SET foreign_key_checks = 1');
 			if ($this->con->driver() == 'pgsql') $this->con->execute('SET CONSTRAINTS ALL DEFERRED');
@@ -210,11 +214,12 @@
 		catch (Exception $e)
 		{
+			@fclose($this->fp);
 			$this->con->rollback();
-			throw $e;
-		}
-		
+			throw new Exception($e->getMessage().' - '.sprintf(__('Error raised at line %s'),$line->__line));
+		}
+		@fclose($this->fp);
 		$this->con->commit();
 	}
-	
+
 	public function importFull()
 	{
@@ -222,9 +227,9 @@
 			throw new Exception(__('File is not a full export.'));
 		}
-		
+
 		if (!$this->core->auth->isSuperAdmin()) {
 			throw new Exception(__('Permission denied.'));
 		}
-		
+
 		$this->con->begin();
 		$this->con->execute('DELETE FROM '.$this->prefix.'blog');
@@ -232,5 +237,6 @@
 		$this->con->execute('DELETE FROM '.$this->prefix.'spamrule');
 		$this->con->execute('DELETE FROM '.$this->prefix.'setting');
-		
+		$this->con->execute('DELETE FROM '.$this->prefix.'log');
+
 		try
 		{
@@ -291,15 +297,16 @@
 		catch (Exception $e)
 		{
+			@fclose($this->fp);
 			$this->con->rollback();
-			throw $e;
-		}
-		
+			throw new Exception($e->getMessage().' - '.sprintf(__('Error raised at line %s'),$line->__line));
+		}
+		@fclose($this->fp);
 		$this->con->commit();
 	}
-	
+
 	private function insertBlog($blog)
 	{
 		$this->cur_blog->clean();
-		
+
 		$this->cur_blog->blog_id     = (string) $blog->blog_id;
 		$this->cur_blog->blog_uid    = (string) $blog->blog_uid;
@@ -309,14 +316,14 @@
 		$this->cur_blog->blog_name   = (string) $blog->blog_name;
 		$this->cur_blog->blog_desc   = (string) $blog->blog_desc;
-		
+
 		$this->cur_blog->blog_status = $blog->exists('blog_status') ? (integer) $blog->blog_status : 1;
-		
+
 		$this->cur_blog->insert();
 	}
-	
+
 	private function insertCategory($category)
 	{
 		$this->cur_category->clean();
-		
+
 		$this->cur_category->cat_id       = (string) $category->cat_id;
 		$this->cur_category->blog_id      = (string) $category->blog_id;
@@ -324,5 +331,5 @@
 		$this->cur_category->cat_url      = (string) $category->cat_url;
 		$this->cur_category->cat_desc     = (string) $category->cat_desc;
-		
+
 		if (!$this->has_categories && $category->exists('cat_lft') && $category->exists('cat_rgt')) {
 			$this->cur_category->cat_lft = (integer) $category->cat_lft;
@@ -335,12 +342,12 @@
 			$this->cur_category->cat_rgt = $this->stack['cat_lft'][$category->blog_id]++;
 		}
-		
+
 		$this->cur_category->insert();
 	}
-	
+
 	private function insertLink($link)
 	{
 		$this->cur_link->clean();
-		
+
 		$this->cur_link->link_id       = (integer) $link->link_id;
 		$this->cur_link->blog_id       = (string) $link->blog_id;
@@ -351,12 +358,12 @@
 		$this->cur_link->link_xfn      = (string) $link->link_xfn;
 		$this->cur_link->link_position = (integer) $link->link_position;
-		
+
 		$this->cur_link->insert();
 	}
-	
+
 	private function insertSetting($setting)
 	{
 		$this->cur_setting->clean();
-		
+
 		$this->cur_setting->setting_id    = (string) $setting->setting_id;
 		$this->cur_setting->blog_id       = !$setting->blog_id ? null : (string) $setting->blog_id;
@@ -365,8 +372,8 @@
 		$this->cur_setting->setting_type  = (string) $setting->setting_type;
 		$this->cur_setting->setting_label = (string) $setting->setting_label;
-		
+
 		$this->cur_setting->insert();
 	}
-	
+
 	private function insertPref($pref)
 	{
@@ -374,7 +381,7 @@
 			return;
 		}
-		
+
 		$this->cur_pref->clean();
-		
+
 		$this->cur_pref->pref_id    = (string) $pref->pref_id;
 		$this->cur_pref->user_id    = !$pref->user_id ? null : (string) $pref->user_id;
@@ -383,8 +390,8 @@
 		$this->cur_pref->pref_type  = (string) $pref->pref_type;
 		$this->cur_pref->pref_label = (string) $pref->pref_label;
-		
+
 		$this->cur_pref->insert();
 	}
-	
+
 	private function insertUser($user)
 	{
@@ -392,7 +399,7 @@
 			return;
 		}
-		
+
 		$this->cur_user->clean();
-		
+
 		$this->cur_user->user_id           = (string) $user->user_id;
 		$this->cur_user->user_super        = (integer) $user->user_super;
@@ -410,36 +417,36 @@
 		$this->cur_user->user_creadt       = (string) $user->user_creadt;
 		$this->cur_user->user_upddt        = (string) $user->user_upddt;
-		
+
 		$this->cur_user->user_desc = $user->exists('user_desc') ? (string) $user->user_desc : null;
 		$this->cur_user->user_options = $user->exists('user_options') ? (string) $user->user_options : null;
 		$this->cur_user->user_status = $user->exists('user_status') ? (integer) $user->user_status : 1;
-		
+
 		$this->cur_user->insert();
-		
+
 		$this->stack['users'][$user->user_id] = true;
 	}
-	
+
 	private function insertPermissions($permissions)
 	{
 		$this->cur_permissions->clean();
-		
+
 		$this->cur_permissions->user_id     = (string) $permissions->user_id;
 		$this->cur_permissions->blog_id     = (string) $permissions->blog_id;
 		$this->cur_permissions->permissions = (string) $permissions->permissions;
-		
+
 		$this->cur_permissions->insert();
 	}
-	
+
 	private function insertPost($post)
 	{
 		$this->cur_post->clean();
-		
+
 		$cat_id = (integer) $post->cat_id;
 		if (!$cat_id) {
 			$cat_id = null;
 		}
-		
+
 		$post_password = $post->post_password ? (string) $post->post_password : null;
-		
+
 		$this->cur_post->post_id            = (integer) $post->post_id;
 		$this->cur_post->blog_id            = (string) $post->blog_id;
@@ -468,25 +475,25 @@
 		$this->cur_post->nb_comment         = (integer) $post->nb_comment;
 		$this->cur_post->nb_trackback       = (integer) $post->nb_trackback;
-		
+
 		$this->cur_post->post_tz = $post->exists('post_tz') ? (string) $post->post_tz : 'UTC';
-		
+
 		$this->cur_post->insert();
 	}
-	
+
 	private function insertMeta($meta)
 	{
 		$this->cur_meta->clean();
-		
+
 		$this->cur_meta->meta_id   = (string) $meta->meta_id;
 		$this->cur_meta->meta_type = (string) $meta->meta_type;
 		$this->cur_meta->post_id   = (integer) $meta->post_id;
-		
+
 		$this->cur_meta->insert();
 	}
-	
+
 	private function insertMedia($media)
 	{
 		$this->cur_media->clean();
-		
+
 		$this->cur_media->media_id      = (integer) $media->media_id;
 		$this->cur_media->user_id       = (string) $media->user_id;
@@ -499,26 +506,26 @@
 		$this->cur_media->media_upddt   = (string) $media->media_upddt;
 		$this->cur_media->media_private = (integer) $media->media_private;
-		
+
 		$this->cur_media->media_dir = $media->exists('media_dir') ? (string) $media->media_dir : dirname($media->media_file);
-		
+
 		if (!$this->mediaExists()) {
 			$this->cur_media->insert();
 		}
 	}
-	
+
 	private function insertPostMedia($post_media)
 	{
 		$this->cur_post_media->clean();
-		
+
 		$this->cur_post_media->media_id = (integer) $post_media->media_id;
 		$this->cur_post_media->post_id  = (integer) $post_media->post_id;
-		
+
 		$this->cur_post_media->insert();
 	}
-	
+
 	private function insertLog($log)
 	{
 		$this->cur_log->clean();
-		
+
 		$this->cur_log->log_id    = (integer) $log->log_id;
 		$this->cur_log->user_id   = (string) $log->user_id;
@@ -527,23 +534,23 @@
 		$this->cur_log->log_ip    = (string) $log->log_ip;
 		$this->cur_log->log_msg   = (string) $log->log_msg;
-		
+
 		$this->cur_log->insert();
 	}
-	
+
 	private function insertPing($ping)
 	{
 		$this->cur_ping->clean();
-		
+
 		$this->cur_ping->post_id  = (integer) $ping->post_id;
 		$this->cur_ping->ping_url = (string) $ping->ping_url;
 		$this->cur_ping->ping_dt  = (string) $ping->ping_dt;
-		
+
 		$this->cur_ping->insert();
 	}
-	
+
 	private function insertComment($comment)
 	{
 		$this->cur_comment->clean();
-		
+
 		$this->cur_comment->comment_id          = (integer) $comment->comment_id;
 		$this->cur_comment->post_id             = (integer) $comment->post_id;
@@ -559,29 +566,29 @@
 		$this->cur_comment->comment_spam_status = (integer) $comment->comment_spam_status;
 		$this->cur_comment->comment_trackback   = (integer) $comment->comment_trackback;
-		
+
 		$this->cur_comment->comment_tz = $comment->exists('comment_tz') ? (string) $comment->comment_tz : 'UTC';
 		$this->cur_comment->comment_spam_filter = $comment->exists('comment_spam_filter') ? (integer) $comment->comment_spam_filter : null;
-		
+
 		$this->cur_comment->insert();
 	}
-	
+
 	private function insertSpamRule($spamrule)
 	{
 		$this->cur_spamrule->clean();
-		
+
 		$this->cur_spamrule->rule_id      = (integer) $spamrule->rule_id;
 		$this->cur_spamrule->blog_id      = !$spamrule->blog_id ? null : (string) $spamrule->blog_id;
 		$this->cur_spamrule->rule_type    = (string) $spamrule->rule_type;
 		$this->cur_spamrule->rule_content = (string) $spamrule->rule_content;
-		
+
 		$this->cur_spamrule->insert();
 	}
-	
+
 	private function insertCategorySingle($category)
 	{
 		$this->cur_category->clean();
-		
+
 		$m = $this->searchCategory($this->stack['categories'],$category->cat_url);
-		
+
 		$old_id = $category->cat_id;
 		if ($m !== false)
@@ -594,21 +601,21 @@
 			$category->cat_id = $cat_id;
 			$category->blog_id = $this->blog_id;
-			
+
 			$this->insertCategory($category);
 			$this->stack['cat_id']++;
 		}
-		
+
 		$this->old_ids['category'][(integer) $old_id] = $cat_id;
 	}
-	
+
 	private function insertLinkSingle($link)
 	{
 		$link->blog_id = $this->blog_id;
 		$link->link_id = $this->stack['link_id'];
-		
+
 		$this->insertLink($link);
 		$this->stack['link_id']++;
 	}
-	
+
 	private function insertPostSingle($post)
 	{
@@ -616,15 +623,15 @@
 			$post_id = $this->stack['post_id'];
 			$this->old_ids['post'][(integer) $post->post_id] = $post_id;
-			
+
 			$cat_id = $post->cat_id ? $this->old_ids['category'][(integer) $post->cat_id] : null;
-			
+
 			$post->post_id = $post_id;
 			$post->cat_id = $cat_id;
 			$post->blog_id = $this->blog_id;
-			
+
 			$post->post_url = $this->core->blog->getPostURL(
 				$post->post_url,$post->post_dt,$post->post_title,$post->post_id
 			);
-			
+
 			$this->insertPost($post);
 			$this->stack['post_id']++;
@@ -633,5 +640,5 @@
 		}
 	}
-	
+
 	private function insertMetaSingle($meta)
 	{
@@ -643,19 +650,19 @@
 		}
 	}
-	
+
 	private function insertMediaSingle($media)
 	{
 		$media_id = $this->stack['media_id'];
 		$old_id = $media->media_id;
-		
+
 		$media->media_id = $media_id;
 		$media->media_path = $this->core->blog->settings->system->public_path;
 		$media->user_id = $this->getUserId($media->user_id);
-		
+
 		$this->insertMedia($media);
 		$this->stack['media_id']++;
 		$this->old_ids['media'][(integer) $old_id] = $media_id;
 	}
-	
+
 	private function insertPostMediaSingle($post_media)
 	{
@@ -664,5 +671,5 @@
 			$post_media->media_id = $this->old_ids['media'][(integer) $post_media->media_id];
 			$post_media->post_id = $this->old_ids['post'][(integer) $post_media->post_id];
-			
+
 			$this->insertPostMedia($post_media);
 		} elseif (!isset($this->old_ids['media'][(integer) $post_media->media_id])) {
@@ -672,10 +679,10 @@
 		}
 	}
-	
+
 	private function insertPingSingle($ping)
 	{
 		if (isset($this->old_ids['post'][(integer) $ping->post_id])) {
 			$ping->post_id = $this->old_ids['post'][(integer) $ping->post_id];
-			
+
 			$this->insertPing($ping);
 		} else {
@@ -683,13 +690,13 @@
 		}
 	}
-	
+
 	private function insertCommentSingle($comment)
 	{
 		if (isset($this->old_ids['post'][(integer) $comment->post_id])) {
 			$comment_id = $this->stack['comment_id'];
-			
+
 			$comment->comment_id = $comment_id;
 			$comment->post_id = $this->old_ids['post'][(integer) $comment->post_id];
-			
+
 			$this->insertComment($comment);
 			$this->stack['comment_id']++;
@@ -698,5 +705,5 @@
 		}
 	}
-	
+
 	private static function throwIdError($name,$line,$related)
 	{
@@ -708,5 +715,5 @@
 		));
 	}
-	
+
 	public function searchCategory($rs,$url)
 	{
@@ -717,8 +724,8 @@
 			}
 		}
-		
+
 		return false;
 	}
-	
+
 	public function getUserId($user_id)
 	{
@@ -730,5 +737,5 @@
 				$user_id = preg_replace('/[^A-Za-z0-9]$/','',$user_id);
 				$user_id .= strlen($user_id) < 2 ? '-a' : '';
-				
+
 				# We change user_id, we need to check again
 				if (!$this->userExists($user_id))
@@ -737,7 +744,7 @@
 					$this->cur_user->user_id = (string) $user_id;
 					$this->cur_user->user_pwd = md5(uniqid());
-					
+
 					$this->core->addUser($this->cur_user);
-					
+
 					$this->stack['users'][$user_id] = true;
 				}
@@ -749,8 +756,8 @@
 			}
 		}
-		
+
 		return $user_id;
 	}
-	
+
 	private function userExists($user_id)
 	{
@@ -758,15 +765,15 @@
 			return $this->stack['users'][$user_id];
 		}
-		
+
 		$strReq = 'SELECT user_id '.
 				'FROM '.$this->prefix.'user '.
 				"WHERE user_id = '".$this->con->escape($user_id)."' ";
-		
+
 		$rs = $this->con->select($strReq);
-		
+
 		$this->stack['users'][$user_id] = !$rs->isEmpty();
 		return $this->stack['users'][$user_id];
 	}
-	
+
 	private function prefExists($pref_ws,$pref_id,$user_id)
 	{
@@ -780,10 +787,10 @@
 			$strReq .= "AND user_id = '".$this->con->escape($user_id)."' ";
 		}
-		
+
 		$rs = $this->con->select($strReq);
-		
+
 		return !$rs->isEmpty();
 	}
-	
+
 	private function mediaExists()
 	{
@@ -792,10 +799,10 @@
 				"WHERE media_path = '".$this->con->escape($this->cur_media->media_path)."' ".
 				"AND media_file = '".$this->con->escape($this->cur_media->media_file)."' ";
-		
+
 		$rs = $this->con->select($strReq);
-		
+
 		return !$rs->isEmpty();
 	}
-	
+
 	private function prepareDC12line(&$line)
 	{
@@ -804,5 +811,5 @@
 		'dc_wiki_comments','dc_use_smilies','dc_date_format','dc_time_format',
 		'dc_url_scan');
-		
+
 		switch ($line->__name)
 		{
@@ -830,5 +837,5 @@
 				$line->post_content_xhtml = $line->post_content;
 				$line->post_excerpt_xhtml = $line->post_chapo;
-				
+
 				if ($line->post_format == 'wiki') {
 					$line->post_content = $line->post_content_wiki;
@@ -838,11 +845,11 @@
 					$line->post_excerpt = $line->post_chapo;
 				}
-				
+
 				$line->post_status = (integer) $line->post_pub;
 				$line->post_type = 'post';
 				$line->blog_id = 'default';
-				
+
 				$line->drop('post_titre_url','post_content_wiki','post_chapo','post_chapo_wiki','post_pub');
-				
+
 				break;
 			case 'post_meta':
@@ -862,8 +869,7 @@
 				break;
 		}
-		
+
 		# --BEHAVIOR-- importPrepareDC12
 		$this->core->callBehavior('importPrepareDC12',$line,$this,$this->core);
 	}
 }
-?>
