]> git.joonet.de Git - adminer.git/commitdiff
SimpleDB: Handle XML error
authorJakub Vrana <jakub@vrana.cz>
Sun, 7 Jul 2013 05:33:19 +0000 (22:33 -0700)
committerJakub Vrana <jakub@vrana.cz>
Tue, 9 Jul 2013 17:54:54 +0000 (10:54 -0700)
adminer/drivers/simpledb.inc.php

index a7ae0108fc78f50429c888b0df8996c79ee8a27d..4d12e2be58e8297abd9210bfc0539e567a3e1e1f 100644 (file)
@@ -394,10 +394,17 @@ if (isset($_GET["simpledb"])) {
                        'content' => $query,
                        'ignore_errors' => 1, // available since PHP 5.2.10
                ))));
-               if (!$file || !($xml = simplexml_load_string($file))) {
+               if (!$file) {
                        $connection->error = $php_errormsg;
                        return false;
                }
+               libxml_use_internal_errors(true);
+               $xml = simplexml_load_string($file);
+               if (!$xml) {
+                       $error = libxml_get_last_error();
+                       $connection->error = $error->message;
+                       return false;
+               }
                if ($xml->Errors) {
                        $error = $xml->Errors->Error;
                        $connection->error = "$error->Message ($error->Code)";