From 6fe9827eea249f3e82f5a2368ebc1ec073fb4a91 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 21 Feb 2025 13:53:18 +0100 Subject: [PATCH] Trim trailing whitespace --- .editorconfig | 1 + adminer/call.inc.php | 8 +- adminer/drivers/mongo.inc.php | 12 +- adminer/event.inc.php | 2 +- adminer/foreign.inc.php | 4 +- adminer/include/adminer.inc.php | 6 +- adminer/include/auth.inc.php | 6 +- adminer/include/connect.inc.php | 10 +- adminer/include/driver.inc.php | 28 +- adminer/include/editing.inc.php | 2 +- adminer/include/pdo.inc.php | 26 +- adminer/include/tmpfile.inc.php | 8 +- adminer/lang/bg.inc.php | 58 ++-- adminer/lang/cs.inc.php | 58 ++-- adminer/lang/el.inc.php | 58 ++-- adminer/lang/fa.inc.php | 54 ++-- adminer/lang/fi.inc.php | 58 ++-- adminer/lang/lt.inc.php | 58 ++-- adminer/lang/pl.inc.php | 52 ++-- adminer/lang/sk.inc.php | 2 +- adminer/lang/sl.inc.php | 56 ++-- adminer/lang/uk.inc.php | 58 ++-- adminer/lang/vi.inc.php | 56 ++-- adminer/lang/xx.inc.php | 58 ++-- adminer/lang/zh-tw.inc.php | 58 ++-- adminer/lang/zh.inc.php | 2 +- adminer/schema.inc.php | 8 +- adminer/sql.inc.php | 2 +- compile.php | 8 +- designs/esterka/adminer.css | 522 ++++++++++++++++---------------- editor/db.inc.php | 4 +- editor/include/adminer.inc.php | 2 +- editor/sqlite.php | 4 +- plugins/database-hide.php | 6 +- plugins/designs.php | 8 +- plugins/drivers/elastic5.php | 2 +- plugins/drivers/firebird.php | 12 +- plugins/drivers/simpledb.php | 2 +- plugins/dump-alter.php | 10 +- plugins/dump-bz2.php | 6 +- plugins/dump-date.php | 2 +- plugins/dump-json.php | 6 +- plugins/dump-xml.php | 6 +- plugins/edit-foreign.php | 6 +- plugins/email-table.php | 8 +- plugins/enum-option.php | 4 +- plugins/foreign-system.php | 4 +- plugins/frames.php | 6 +- plugins/login-ip.php | 2 +- plugins/login-otp.php | 8 +- plugins/login-password-less.php | 4 +- plugins/login-servers.php | 10 +- plugins/login-ssl.php | 2 +- plugins/login-table.php | 6 +- plugins/master-slave.php | 6 +- plugins/plugin.php | 18 +- plugins/sql-log.php | 6 +- plugins/translation.php | 10 +- plugins/version-noverify.php | 4 +- 59 files changed, 757 insertions(+), 756 deletions(-) diff --git a/.editorconfig b/.editorconfig index f862bd3b..b67cfe0d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,6 +5,7 @@ root = true charset = utf-8 end_of_line = lf insert_final_newline = true +trim_trailing_whitespace = true [*.{php,css,js}] indent_style = tab diff --git a/adminer/call.inc.php b/adminer/call.inc.php index 20de834f..27ce9f7a 100644 --- a/adminer/call.inc.php +++ b/adminer/call.inc.php @@ -28,13 +28,13 @@ if (!$error && $_POST) { } $call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val); } - + $query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . table($PROCEDURE) . "(" . implode(", ", $call) . ")"; $start = microtime(true); $result = $connection->multi_query($query); $affected = $connection->affected_rows; // getting warnings overwrites this echo $adminer->selectQuery($query, $start, !$result); - + if (!$result) { echo "

" . error() . "\n"; } else { @@ -42,7 +42,7 @@ if (!$error && $_POST) { if (is_object($connection2)) { $connection2->select_db(DB); } - + do { $result = $connection->store_result(); if (is_object($result)) { @@ -53,7 +53,7 @@ if (!$error && $_POST) { ; } } while ($connection->next_result()); - + if ($out) { select($connection->query("SELECT " . implode(", ", $out))); } diff --git a/adminer/drivers/mongo.inc.php b/adminer/drivers/mongo.inc.php index ac89542d..c9804abc 100644 --- a/adminer/drivers/mongo.inc.php +++ b/adminer/drivers/mongo.inc.php @@ -24,7 +24,7 @@ if (isset($_GET["mongo"])) { $this->error = $e->getMessage(); } } - + function query($query) { return false; } @@ -109,7 +109,7 @@ if (isset($_GET["mongo"])) { class Min_Driver extends Min_SQL { public $primary = "_id"; - + function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) { $select = ($select == array("*") ? array() @@ -127,7 +127,7 @@ if (isset($_GET["mongo"])) { ->skip($page * $limit) ); } - + function insert($table, $set) { try { $return = $this->_conn->_db->selectCollection($table)->insert($set); @@ -219,7 +219,7 @@ if (isset($_GET["mongo"])) { $this->_link = new $class($uri, $options); $this->executeCommand($options["db"], array('ping' => 1)); } - + function executeCommand($db, $command) { $class = 'MongoDB\Driver\Command'; try { @@ -229,7 +229,7 @@ if (isset($_GET["mongo"])) { return array(); } } - + function executeBulkWrite($namespace, $bulk, $counter) { try { $results = $this->_link->executeBulkWrite($namespace, $bulk); @@ -579,7 +579,7 @@ if (isset($_GET["mongo"])) { "(date)>=", "(date)<=", ); - + } function table($idf) { diff --git a/adminer/event.inc.php b/adminer/event.inc.php index 9404211b..6f62a7e8 100644 --- a/adminer/event.inc.php +++ b/adminer/event.inc.php @@ -15,7 +15,7 @@ if ($_POST && !$error) { : "AT " . q($row["STARTS"]) ) . " ON COMPLETION" . ($row["ON_COMPLETION"] ? "" : " NOT") . " PRESERVE" ; - + queries_redirect(substr(ME, 0, -1), ($EVENT != "" ? lang('Event has been altered.') : lang('Event has been created.')), queries(($EVENT != "" ? "ALTER EVENT " . idf_escape($EVENT) . $schedule . ($EVENT != $row["EVENT_NAME"] ? "\nRENAME TO " . idf_escape($row["EVENT_NAME"]) : "") diff --git a/adminer/foreign.inc.php b/adminer/foreign.inc.php index 726d6c79..75a909e9 100644 --- a/adminer/foreign.inc.php +++ b/adminer/foreign.inc.php @@ -6,7 +6,7 @@ $row = $_POST; if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change-js"]) { $message = ($_POST["drop"] ? lang('Foreign key has been dropped.') : ($name != "" ? lang('Foreign key has been altered.') : lang('Foreign key has been created.'))); $location = ME . "table=" . urlencode($TABLE); - + if (!$_POST["drop"]) { $row["source"] = array_filter($row["source"], 'strlen'); ksort($row["source"]); // enforce input order @@ -16,7 +16,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change- } $row["target"] = $target; } - + if ($jush == "sqlite") { queries_redirect($location, $message, recreate_table($TABLE, $TABLE, array(), array(), array(" $name" => ($_POST["drop"] ? "" : " " . format_foreign_key($row))))); } else { diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 00d2fe3f..94399ec3 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -39,7 +39,7 @@ class Adminer { function bruteForceKey() { return $_SERVER["REMOTE_ADDR"]; } - + /** Get server name displayed in breadcrumbs * @param string * @return string HTML code or null @@ -128,7 +128,7 @@ class Adminer { echo "

\n"; echo checkbox("auth[permanent]", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n"; } - + /** Get login form field * @param string * @param string HTML @@ -479,7 +479,7 @@ class Adminer { echo "\n"; echo "\n"; } - + /** Print command box in select * @return bool whether to print default commands */ diff --git a/adminer/include/auth.inc.php b/adminer/include/auth.inc.php index ed104154..cbf9518c 100644 --- a/adminer/include/auth.inc.php +++ b/adminer/include/auth.inc.php @@ -72,14 +72,14 @@ if ($auth) { ) { redirect(auth_url($vendor, $server, $username, $db)); } - + } elseif ($_POST["logout"] && (!$has_token || verify_token())) { foreach (array("pwds", "db", "dbs", "queries") as $key) { set_session($key, null); } unset_permanent(); redirect(substr(preg_replace('~\b(username|db|ns)=[^&]*&~', '', ME), 0, -1), lang('Logout successful.') . ' ' . lang('Thanks for using Adminer, consider donating.')); - + } elseif ($permanent && !$_SESSION["pwds"]) { session_regenerate_id(); $private = $adminer->permanentLogin(); @@ -199,7 +199,7 @@ if ($_POST) { : lang('Invalid CSRF token. Send the form again.') . ' ' . lang('If you did not send this request from Adminer then close this page.') ); } - + } elseif ($_SERVER["REQUEST_METHOD"] == "POST") { // posted form with no data means that post_max_size exceeded because Adminer always sends token at least $error = lang('Too big POST data. Reduce the data or increase the %s configuration directive.', "'post_max_size'"); diff --git a/adminer/include/connect.inc.php b/adminer/include/connect.inc.php index 38f477c8..322444cd 100644 --- a/adminer/include/connect.inc.php +++ b/adminer/include/connect.inc.php @@ -8,7 +8,7 @@ function connect_error() { if ($_POST["db"] && !$error) { queries_redirect(substr(ME, 0, -1), lang('Databases have been dropped.'), drop_databases($_POST["db"])); } - + page_header(lang('Select database'), $error, false); echo "