From e51f32d00103d2bd45fbc7e33ea8434cb7372bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 10 Jul 2013 14:35:34 +0200 Subject: [PATCH] Properly set global message --- libraries/plugins/import/ImportLdi.class.php | 6 +++--- libraries/plugins/import/ImportOds.class.php | 8 ++++---- libraries/plugins/import/ImportShp.class.php | 7 ++----- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/libraries/plugins/import/ImportLdi.class.php b/libraries/plugins/import/ImportLdi.class.php index dd3dc3da4d..518b0db8cc 100644 --- a/libraries/plugins/import/ImportLdi.class.php +++ b/libraries/plugins/import/ImportLdi.class.php @@ -97,7 +97,7 @@ class ImportLdi extends AbstractImportCsv */ public function doImport() { - global $finished, $error, $import_file, $compression, $charset_conversion, $table; + global $finished, $import_file, $compression, $charset_conversion, $table; global $ldi_local_option, $ldi_replace, $ldi_ignore, $ldi_terminated, $ldi_enclosed, $ldi_escaped, $ldi_new_line, $skip_queries, $ldi_columns; @@ -106,10 +106,10 @@ class ImportLdi extends AbstractImportCsv || $charset_conversion ) { // We handle only some kind of data! - $message = PMA_Message::error( + $GLOBALS['message'] = PMA_Message::error( __('This plugin does not support compressed imports!') ); - $error = true; + $GLOBALS['error'] = true; return; } diff --git a/libraries/plugins/import/ImportOds.class.php b/libraries/plugins/import/ImportOds.class.php index 4aa412afa6..e1b10b8691 100644 --- a/libraries/plugins/import/ImportOds.class.php +++ b/libraries/plugins/import/ImportOds.class.php @@ -167,21 +167,21 @@ class ImportOds extends ImportPlugin if ($xml === false) { $sheets = array(); - $message = PMA_Message::error( + $GLOBALS['message'] = PMA_Message::error( __( 'The XML file specified was either malformed or incomplete.' . ' Please correct the issue and try again.' ) ); - $error = true; + $GLOBALS['error'] = true; } else { $root = $xml->children('office', true)->{'body'}->{'spreadsheet'}; if (empty($root)) { $sheets = array(); - $message = PMA_Message::error( + $GLOBALS['message'] = PMA_Message::error( __('Could not parse OpenDocument Spreadsheet!') ); - $error = true; + $GLOBALS['error'] = true; } else { $sheets = $root->children('table', true); } diff --git a/libraries/plugins/import/ImportShp.class.php b/libraries/plugins/import/ImportShp.class.php index 56721149f7..ea82007164 100644 --- a/libraries/plugins/import/ImportShp.class.php +++ b/libraries/plugins/import/ImportShp.class.php @@ -79,7 +79,7 @@ class ImportShp extends ImportPlugin public function doImport() { global $db, $error, $finished, $compression, - $import_file, $local_import_file; + $import_file, $local_import_file, $message; if ((int) ini_get('memory_limit') < 512) { @ini_set('memory_limit', '512M'); @@ -87,9 +87,6 @@ class ImportShp extends ImportPlugin @set_time_limit(300); $GLOBALS['finished'] = false; - $buffer = ''; - $eof = false; - $shp = new PMA_ShapeFile(1); // If the zip archive has more than one file, @@ -339,4 +336,4 @@ class ImportShp extends ImportPlugin $buffer = substr($buffer, $length); return $result; } -} \ No newline at end of file +}