]> git.joonet.de Git - adminer.git/commitdiff
Fix style
authorJakub Vrana <jakub@vrana.cz>
Mon, 17 Feb 2025 14:48:23 +0000 (15:48 +0100)
committerJakub Vrana <jakub@vrana.cz>
Wed, 19 Feb 2025 10:16:45 +0000 (11:16 +0100)
adminer/elastic.php
adminer/include/adminer.inc.php
adminer/include/functions.inc.php
plugins/drivers/elastic.php
plugins/drivers/elastic5.php

index ccfc59755f7ce47d62977aba37651b8bf3b4478c..3ceca576adeb0fd6c32b88c821ae3458d4626538 100644 (file)
@@ -4,10 +4,10 @@ function adminer_object() {
        include_once "../plugins/login-password-less.php";
        include_once "../plugins/drivers/elastic.php";
        include_once "../plugins/drivers/elastic5.php";
-       return new AdminerPlugin([
+       return new AdminerPlugin(array(
                // TODO: inline the result of password_hash() so that the password is not visible in source codes
                new AdminerLoginPasswordLess(password_hash("YOUR_PASSWORD_HERE", PASSWORD_DEFAULT)),
-       ]);
+       ));
 }
 
 include "./index.php";
index e5dafa71b55661feea08e900d0ef388ab90636e3..210f5b171c73873d45c41e27cb9eb6fbb5f974eb 100644 (file)
@@ -248,8 +248,7 @@ class Adminer {
        * @param string query to be executed
        * @return string escaped query to be printed
        */
-       function sqlCommandQuery($query)
-       {
+       function sqlCommandQuery($query) {
                return shorten_utf8(trim($query), 1000);
        }
 
index 32fb0184b0bd6705929c3e9317741ad20eaf2f6e..c57a05739a52878ecb6939251b435486e484f719 100644 (file)
@@ -964,8 +964,8 @@ function input($field, $value, $function) {
                if ($input != "") {
                        echo $input;
                } elseif (preg_match('~bool~', $field["type"])) {
-                       echo "<input type='hidden'$attrs value='0'>" .
-                               "<input type='checkbox'" . (preg_match('~^(1|t|true|y|yes|on)$~i', $value) ? " checked='checked'" : "") . "$attrs value='1'>";
+                       echo "<input type='hidden'$attrs value='0'>"
+                               "<input type='checkbox'" . (preg_match('~^(1|t|true|y|yes|on)$~i', $value) ? " checked='checked'" : "") . "$attrs value='1'>";
                } elseif ($field["type"] == "set") { //! 64 bits
                        preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
                        foreach ($matches[1] as $i => $val) {
index cf4b17f255bd5c610b6ff2ec6e557335950d26c6..399d7ccab152ae0cf5ccaef4d103fcd391b3b6e6 100644 (file)
@@ -22,7 +22,7 @@ if (isset($_GET["elastic"])) {
                                $file = @file_get_contents("$this->_url/" . ltrim($path, '/'), false, stream_context_create(array('http' => array(
                                        'method' => $method,
                                        'content' => $content !== null ? json_encode($content) : null,
-                                       'header' => $content !== null ? 'Content-Type: application/json' : [],
+                                       'header' => $content !== null ? 'Content-Type: application/json' : array(),
                                        'ignore_errors' => 1,
                                        'follow_location' => 0,
                                        'max_redirects' => 0,
index 1ad0cb27296d8c6b476febee88d9ca0ae8f7a8c6..a2fec6bafb87ccbb5f27db2a26679629c3a0ae23 100644 (file)
@@ -190,7 +190,7 @@ if (isset($_GET["elastic5"])) {
                                if ($select != array("*")) {
                                        $fields = array();
                                        foreach ($select as $key) {
-                                               $fields[$key] = $key == "_id" ? [$hit["_id"]] : $hit['fields'][$key];
+                                               $fields[$key] = $key == "_id" ? array($hit["_id"]) : $hit['fields'][$key];
                                        }
                                }