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.'));
 	}
 }
-?>
