]> git.joonet.de Git - adminer.git/commitdiff
Hide SQL export if driver doesn't support it
authorJakub Vrana <jakub@vrana.cz>
Tue, 25 Feb 2025 16:07:27 +0000 (17:07 +0100)
committerJakub Vrana <jakub@vrana.cz>
Wed, 26 Feb 2025 11:20:34 +0000 (12:20 +0100)
adminer/include/adminer.inc.php

index 593c49feb3659064dbd5d8c44b24fb6ffe7fd418..6fe2601e363a23e950b29bf32a47d6e9f0f1d5b5 100644 (file)
@@ -769,7 +769,7 @@ class Adminer {
        * @return array empty to disable export
        */
        function dumpFormat() {
-               return array('sql' => 'SQL', 'csv' => 'CSV,', 'csv;' => 'CSV;', 'tsv' => 'TSV');
+               return (support("dump") ? array('sql' => 'SQL') : array()) + array('csv' => 'CSV,', 'csv;' => 'CSV;', 'tsv' => 'TSV');
        }
 
        /** Export database structure
@@ -1011,9 +1011,7 @@ bodyLoad('<?php echo (is_object($connection) ? preg_replace('~^(\d\.?\d).*~s', '
                                        $actions[] = "<a href='" . h(ME) . "sql='" . bold(isset($_GET["sql"]) && !isset($_GET["import"])) . ">" . lang('SQL command') . "</a>";
                                        $actions[] = "<a href='" . h(ME) . "import='" . bold(isset($_GET["import"])) . ">" . lang('Import') . "</a>";
                                }
-                               if (support("dump")) {
-                                       $actions[] = "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "' id='dump'" . bold(isset($_GET["dump"])) . ">" . lang('Export') . "</a>";
-                               }
+                               $actions[] = "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "' id='dump'" . bold(isset($_GET["dump"])) . ">" . lang('Export') . "</a>";
                        }
                        $in_db = $_GET["ns"] !== "" && !$missing && DB != "";
                        if ($in_db) {