]> git.joonet.de Git - adminer.git/commitdiff
Save bytes
authorJakub Vrana <jakub@vrana.cz>
Fri, 12 Feb 2021 15:08:40 +0000 (16:08 +0100)
committerJakub Vrana <jakub@vrana.cz>
Mon, 15 Feb 2021 17:33:19 +0000 (18:33 +0100)
adminer/drivers/pgsql.inc.php
adminer/include/adminer.inc.php
adminer/include/connect.inc.php
adminer/processlist.inc.php

index add56272e5a542ef8d63a5423337625e32e6953c..402b2555dc4dc470830b5b3ce1b7472c21082db0 100644 (file)
@@ -304,7 +304,7 @@ if (isset($_GET["pgsql"])) {
 
        function tables_list() {
                $query = "SELECT table_name, table_type FROM information_schema.tables WHERE table_schema = current_schema()";
-               if (support('materializedview')) {
+               if (support('materializedview')) { // ' - support("materializedview") could be removed by compile.php
                        $query .= "
 UNION ALL
 SELECT matviewname, 'MATERIALIZED VIEW'
index 4990399cafd9f9b98567d5aa55f32a79e11d0821..632e29283e7c24aae28aec33bf94117584e72550 100644 (file)
@@ -1025,8 +1025,8 @@ bodyLoad('<?php echo (is_object($connection) ? preg_replace('~^(\d\.?\d).*~s', '
                        : "<input name='db' value='" . h(DB) . "' autocapitalize='off'>\n"
                );
                echo "<input type='submit' value='" . lang('Use') . "'" . ($databases ? " class='hidden'" : "") . ">\n";
-               if ($missing != "db" && DB != "" && $connection->select_db(DB)) {
-                       if (support("scheme")) {
+               if (support("scheme")) {
+                       if ($missing != "db" && DB != "" && $connection->select_db(DB)) {
                                echo "<br>" . lang('Schema') . ": <select name='ns'>" . optionlist(array("" => "") + $adminer->schemas(), $_GET["ns"]) . "</select>$db_events";
                                if ($_GET["ns"] != "") {
                                        set_schema($_GET["ns"]);
index a3e188fa5dd6894071912af655721d1ccac188f7..38f477c8b35e9f8f071e4277a25a44f884ca3856 100644 (file)
@@ -89,14 +89,16 @@ if (!(DB != "" ? $connection->select_db(DB) : isset($_GET["sql"]) || isset($_GET
        exit;
 }
 
-if (support("scheme") && DB != "" && $_GET["ns"] !== "") {
-       if (!isset($_GET["ns"])) {
-               redirect(preg_replace('~ns=[^&]*&~', '', ME) . "ns=" . get_schema());
-       }
-       if (!set_schema($_GET["ns"])) {
-               header("HTTP/1.1 404 Not Found");
-               page_header(lang('Schema') . ": " . h($_GET["ns"]), lang('Invalid schema.'), true);
-               page_footer("ns");
-               exit;
+if (support("scheme")) {
+       if (DB != "" && $_GET["ns"] !== "") {
+               if (!isset($_GET["ns"])) {
+                       redirect(preg_replace('~ns=[^&]*&~', '', ME) . "ns=" . get_schema());
+               }
+               if (!set_schema($_GET["ns"])) {
+                       header("HTTP/1.1 404 Not Found");
+                       page_header(lang('Schema') . ": " . h($_GET["ns"]), lang('Invalid schema.'), true);
+                       page_footer("ns");
+                       exit;
+               }
        }
 }
index c2affc6a816b3e6d3fe801debb2b333b18bec493..d726161b650715804ffc390799abe95db8b7ab79 100644 (file)
@@ -1,12 +1,14 @@
 <?php
-if (support("kill") && $_POST && !$error) {
-       $killed = 0;
-       foreach ((array) $_POST["kill"] as $val) {
-               if (kill_process($val)) {
-                       $killed++;
+if (support("kill")) {
+       if ($_POST && !$error) {
+               $killed = 0;
+               foreach ((array) $_POST["kill"] as $val) {
+                       if (kill_process($val)) {
+                               $killed++;
+                       }
                }
+               queries_redirect(ME . "processlist=", lang('%d process(es) have been killed.', $killed), $killed || !$_POST["kill"]);
        }
-       queries_redirect(ME . "processlist=", lang('%d process(es) have been killed.', $killed), $killed || !$_POST["kill"]);
 }
 
 page_header(lang('Process list'), $error);