From 65e53a8bb8afd76d4779b0d0e536d7ab2690b439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 17 Mar 2011 16:10:36 +0100 Subject: [PATCH] bug#3212720 Show error message on error. --- libraries/import/ods.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libraries/import/ods.php b/libraries/import/ods.php index c0db7afbf..4bf520016 100644 --- a/libraries/import/ods.php +++ b/libraries/import/ods.php @@ -74,7 +74,14 @@ $xml = simplexml_load_string($buffer, "SimpleXMLElement", LIBXML_COMPACT); unset($buffer); -$sheets = $xml->children('office', true)->{'body'}->{'spreadsheet'}->children('table', true); +if ($xml === FALSE) { + $sheets = array(); + /* TODO: this message should be improved later, used existing because of string freeze */ + $message = PMA_Message::error(__('Error in Processing Request')); + $error = TRUE; +} else { + $sheets = $xml->children('office', true)->{'body'}->{'spreadsheet'}->children('table', true); +} $tables = array();