mirror of
https://github.com/vrana/adminer.git
synced 2025-08-11 09:04:02 +02:00
Fix style
This commit is contained in:
@@ -4,10 +4,10 @@ function adminer_object() {
|
|||||||
include_once "../plugins/login-password-less.php";
|
include_once "../plugins/login-password-less.php";
|
||||||
include_once "../plugins/drivers/elastic.php";
|
include_once "../plugins/drivers/elastic.php";
|
||||||
include_once "../plugins/drivers/elastic5.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
|
// 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)),
|
new AdminerLoginPasswordLess(password_hash("YOUR_PASSWORD_HERE", PASSWORD_DEFAULT)),
|
||||||
]);
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
include "./index.php";
|
include "./index.php";
|
||||||
|
@@ -248,8 +248,7 @@ class Adminer {
|
|||||||
* @param string query to be executed
|
* @param string query to be executed
|
||||||
* @return string escaped query to be printed
|
* @return string escaped query to be printed
|
||||||
*/
|
*/
|
||||||
function sqlCommandQuery($query)
|
function sqlCommandQuery($query) {
|
||||||
{
|
|
||||||
return shorten_utf8(trim($query), 1000);
|
return shorten_utf8(trim($query), 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -964,8 +964,8 @@ function input($field, $value, $function) {
|
|||||||
if ($input != "") {
|
if ($input != "") {
|
||||||
echo $input;
|
echo $input;
|
||||||
} elseif (preg_match('~bool~', $field["type"])) {
|
} elseif (preg_match('~bool~', $field["type"])) {
|
||||||
echo "<input type='hidden'$attrs value='0'>" .
|
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'>";
|
. "<input type='checkbox'" . (preg_match('~^(1|t|true|y|yes|on)$~i', $value) ? " checked='checked'" : "") . "$attrs value='1'>";
|
||||||
} elseif ($field["type"] == "set") { //! 64 bits
|
} elseif ($field["type"] == "set") { //! 64 bits
|
||||||
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
|
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
|
||||||
foreach ($matches[1] as $i => $val) {
|
foreach ($matches[1] as $i => $val) {
|
||||||
|
@@ -22,7 +22,7 @@ if (isset($_GET["elastic"])) {
|
|||||||
$file = @file_get_contents("$this->_url/" . ltrim($path, '/'), false, stream_context_create(array('http' => array(
|
$file = @file_get_contents("$this->_url/" . ltrim($path, '/'), false, stream_context_create(array('http' => array(
|
||||||
'method' => $method,
|
'method' => $method,
|
||||||
'content' => $content !== null ? json_encode($content) : null,
|
'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,
|
'ignore_errors' => 1,
|
||||||
'follow_location' => 0,
|
'follow_location' => 0,
|
||||||
'max_redirects' => 0,
|
'max_redirects' => 0,
|
||||||
|
@@ -190,7 +190,7 @@ if (isset($_GET["elastic5"])) {
|
|||||||
if ($select != array("*")) {
|
if ($select != array("*")) {
|
||||||
$fields = array();
|
$fields = array();
|
||||||
foreach ($select as $key) {
|
foreach ($select as $key) {
|
||||||
$fields[$key] = $key == "_id" ? [$hit["_id"]] : $hit['fields'][$key];
|
$fields[$key] = $key == "_id" ? array($hit["_id"]) : $hit['fields'][$key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user