@@ -1,5 +1,5 @@ |
||
1 | 1 | <select class="form-control"> |
2 | -<?php foreach($this->options as $option): ?> |
|
2 | +<?php foreach ($this->options as $option): ?> |
|
3 | 3 | <option class="<?php echo $this->optionClass ?>" value="<?php |
4 | 4 | echo htmlentities($option) ?>"><?php echo $option ?></option> |
5 | 5 | <?php endforeach ?> |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <select class="form-control"> |
2 | -<?php foreach($this->options as $value => $label): ?> |
|
2 | +<?php foreach ($this->options as $value => $label): ?> |
|
3 | 3 | <option value="<?php echo htmlentities($value) ?>"><?php echo $label ?></option> |
4 | 4 | <?php endforeach ?> |
5 | 5 | </select> |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <div class="input-group"> |
2 | -<?php if(isset($this->schemas) && ($this->schemas)): ?> |
|
2 | +<?php if (isset($this->schemas) && ($this->schemas)): ?> |
|
3 | 3 | <select class="form-control" id="adminer-schema-select"> |
4 | -<?php foreach($this->schemas as $schema): ?> |
|
4 | +<?php foreach ($this->schemas as $schema): ?> |
|
5 | 5 | <option value="<?php echo $schema ?>"><?php echo $schema ?></option> |
6 | 6 | <?php endforeach ?> |
7 | 7 | </select> |
@@ -139,7 +139,7 @@ |
||
139 | 139 | } |
140 | 140 | } |
141 | 141 | if (\preg_match("~ IDENTIFIED BY PASSWORD '([^']+)~", $row[0], $match)) { |
142 | - $password = $match[1]; |
|
142 | + $password = $match[1]; |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | } |
@@ -52,7 +52,7 @@ |
||
52 | 52 | $this->viewAdmin = new ViewAdmin(); |
53 | 53 | $this->viewAdmin->init($this->admin()); |
54 | 54 | } |
55 | - return $this->viewAdmin ; |
|
55 | + return $this->viewAdmin; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -239,8 +239,7 @@ discard block |
||
239 | 239 | $row[$key] = '"' . \str_replace('"', '""', $val) . '"'; |
240 | 240 | } |
241 | 241 | } |
242 | - $separator = $this->options['format'] == 'csv' ? ',' : |
|
243 | - ($this->options['format'] == 'tsv' ? "\t" : ';'); |
|
242 | + $separator = $this->options['format'] == 'csv' ? ',' : ($this->options['format'] == 'tsv' ? "\t" : ';'); |
|
244 | 243 | $this->queries[] = \implode($separator, $row); |
245 | 244 | } |
246 | 245 | |
@@ -354,7 +353,7 @@ discard block |
||
354 | 353 | } else { |
355 | 354 | if (!$insert) { |
356 | 355 | $insert = 'INSERT INTO ' . $this->driver->table($table) . ' (' . |
357 | - \implode(', ', \array_map(function ($key) { |
|
356 | + \implode(', ', \array_map(function($key) { |
|
358 | 357 | return $this->driver->escapeId($key); |
359 | 358 | }, $keys)) . ') VALUES'; |
360 | 359 | } |
@@ -526,8 +526,7 @@ |
||
526 | 526 | } |
527 | 527 | |
528 | 528 | $this->dumpTablesAndViews($database); |
529 | - } |
|
530 | - catch (\Exception $e) { |
|
529 | + } catch (\Exception $e) { |
|
531 | 530 | return $e->getMessage(); |
532 | 531 | } |
533 | 532 | } |
@@ -101,8 +101,7 @@ discard block |
||
101 | 101 | $maxlength = (!\preg_match('~int~', $field->type) && |
102 | 102 | \preg_match('~^(\d+)(,(\d+))?$~', $field->length, $match) ? |
103 | 103 | ((\preg_match("~binary~", $field->type) ? 2 : 1) * $match[1] + (($match[3] ?? null) ? 1 : 0) + |
104 | - (($match[2] ?? false) && !$unsigned ? 1 : 0)) : |
|
105 | - ($this->driver->typeExists($field->type) ? $this->driver->type($field->type) + ($unsigned ? 0 : 1) : 0)); |
|
104 | + (($match[2] ?? false) && !$unsigned ? 1 : 0)) : ($this->driver->typeExists($field->type) ? $this->driver->type($field->type) + ($unsigned ? 0 : 1) : 0)); |
|
106 | 105 | if ($this->driver->jush() == 'sql' && $this->driver->minVersion(5.6) && \preg_match('~time~', $field->type)) { |
107 | 106 | $maxlength += 7; // microtime |
108 | 107 | } |
@@ -243,8 +242,7 @@ discard block |
||
243 | 242 | $value = ( |
244 | 243 | $row !== null ? ( |
245 | 244 | $row[$name] != "" && $this->driver->jush() == "sql" && \preg_match("~enum|set~", $field->type) ? |
246 | - (\is_array($row[$name]) ? \array_sum($row[$name]) : +$row[$name]) : |
|
247 | - (\is_bool($row[$name]) ? +$row[$name] : $row[$name]) |
|
245 | + (\is_array($row[$name]) ? \array_sum($row[$name]) : +$row[$name]) : (\is_bool($row[$name]) ? +$row[$name] : $row[$name]) |
|
248 | 246 | ) : ( |
249 | 247 | !$update && $field->autoIncrement ? "" : (isset($queryOptions["select"]) ? false : $default) |
250 | 248 | ) |
@@ -254,7 +252,7 @@ discard block |
||
254 | 252 | } |
255 | 253 | $function = ( |
256 | 254 | $queryOptions["save"] |
257 | - ? (string)$queryOptions["function"][$name] |
|
255 | + ? (string) $queryOptions["function"][$name] |
|
258 | 256 | : ( |
259 | 257 | $update && \preg_match('~^CURRENT_TIMESTAMP~i', $field->onUpdate) |
260 | 258 | ? "now" |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | { |
24 | 24 | return [ |
25 | 25 | 'select' => $select, |
26 | - 'values' => (array)$options["columns"], |
|
26 | + 'values' => (array) $options["columns"], |
|
27 | 27 | 'columns' => $columns, |
28 | 28 | 'functions' => $this->driver->functions(), |
29 | 29 | 'grouping' => $this->driver->grouping(), |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | return [ |
49 | 49 | // 'where' => $where, |
50 | - 'values' => (array)$options["where"], |
|
50 | + 'values' => (array) $options["where"], |
|
51 | 51 | 'columns' => $columns, |
52 | 52 | 'indexes' => $indexes, |
53 | 53 | 'operators' => $this->driver->operators(), |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | private function getSortingOptions(array $columns, array $options) |
67 | 67 | { |
68 | 68 | $values = []; |
69 | - $descs = (array)$options["desc"]; |
|
70 | - foreach ((array)$options["order"] as $key => $value) { |
|
69 | + $descs = (array) $options["desc"]; |
|
70 | + foreach ((array) $options["order"] as $key => $value) { |
|
71 | 71 | $values[] = [ |
72 | 72 | 'col' => $value, |
73 | 73 | 'desc' => $descs[$key] ?? 0, |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function html(?string $string) |
82 | 82 | { |
83 | - if(!$string) { |
|
83 | + if (!$string) { |
|
84 | 84 | return $string; |
85 | 85 | } |
86 | 86 | return \str_replace("\0", '�', \htmlspecialchars($string, ENT_QUOTES, 'utf-8')); |
@@ -520,9 +520,8 @@ discard block |
||
520 | 520 | \preg_match_all("~'((?:[^']|'')*)'~", $field->length, $matches); |
521 | 521 | foreach ($matches[1] as $i => $val) { |
522 | 522 | $val = \stripcslashes(\str_replace("''", "'", $val)); |
523 | - $checked = (\is_int($value) ? $value == $i + 1 : |
|
524 | - (\is_array($value) ? \in_array($i+1, $value) : $value === $val)); |
|
525 | - $inputs[] = "<label><input type='$type'$attrs value='" . ($i+1) . "'" . |
|
523 | + $checked = (\is_int($value) ? $value == $i + 1 : (\is_array($value) ? \in_array($i + 1, $value) : $value === $val)); |
|
524 | + $inputs[] = "<label><input type='$type'$attrs value='" . ($i + 1) . "'" . |
|
526 | 525 | ($checked ? ' checked' : '') . '>' . $this->html($this->editValue($val, $field)) . '</label>'; |
527 | 526 | } |
528 | 527 | |
@@ -586,8 +585,7 @@ discard block |
||
586 | 585 | } |
587 | 586 | $enumLength = $this->driver->enumLength(); |
588 | 587 | return (\preg_match("~^\\s*\\(?\\s*$enumLength(?:\\s*,\\s*$enumLength)*+\\s*\\)?\\s*\$~", $length) && |
589 | - \preg_match_all("~$enumLength~", $length, $matches) ? '(' . \implode(',', $matches[0]) . ')' : |
|
590 | - \preg_replace('~^[0-9].*~', '(\0)', \preg_replace('~[^-0-9,+()[\]]~', '', $length)) |
|
588 | + \preg_match_all("~$enumLength~", $length, $matches) ? '(' . \implode(',', $matches[0]) . ')' : \preg_replace('~^[0-9].*~', '(\0)', \preg_replace('~[^-0-9,+()[\]]~', '', $length)) |
|
591 | 589 | ); |
592 | 590 | } |
593 | 591 | |
@@ -769,7 +767,7 @@ discard block |
||
769 | 767 | $expressions = []; |
770 | 768 | foreach ($indexes as $i => $index) { |
771 | 769 | if ($index->type == 'FULLTEXT' && $this->input->values['fulltext'][$i] != '') { |
772 | - $columns = \array_map(function ($column) { |
|
770 | + $columns = \array_map(function($column) { |
|
773 | 771 | return $this->driver->escapeId($column); |
774 | 772 | }, $index->columns); |
775 | 773 | $expressions[] = 'MATCH (' . \implode(', ', $columns) . ') AGAINST (' . |
@@ -884,8 +882,7 @@ discard block |
||
884 | 882 | */ |
885 | 883 | private function _selectValue($value, string $link, string $type, string $original) |
886 | 884 | { |
887 | - $clause = ($value === null ? '<i>NULL</i>' : |
|
888 | - (\preg_match('~char|binary|boolean~', $type) && !\preg_match('~var~', $type) ? |
|
885 | + $clause = ($value === null ? '<i>NULL</i>' : (\preg_match('~char|binary|boolean~', $type) && !\preg_match('~var~', $type) ? |
|
889 | 886 | "<code>$value</code>" : $value)); |
890 | 887 | if (\preg_match('~blob|bytea|raw|file~', $type) && !$this->isUtf8($value)) { |
891 | 888 | $clause = '<i>' . $this->trans->lang('%d byte(s)', \strlen($original)) . '</i>'; |
@@ -924,11 +924,9 @@ |
||
924 | 924 | if ($link === '') { |
925 | 925 | if ($this->isMail($value)) { |
926 | 926 | $link = "mailto:$value"; |
927 | - } |
|
928 | - elseif ($this->isUrl($value)) { |
|
927 | + } elseif ($this->isUrl($value)) { |
|
929 | 928 | $link = $value; // IE 11 and all modern browsers hide referrer |
930 | - } |
|
931 | - else { |
|
929 | + } else { |
|
932 | 930 | $link = ''; |
933 | 931 | } |
934 | 932 | } |