@@ -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> |
@@ -96,8 +96,7 @@ discard block |
||
| 96 | 96 | if ($rowCount > 0) { |
| 97 | 97 | $numRows = $statement->rowCount(); |
| 98 | 98 | $message = ($numRows ? ($limit && $numRows > $limit ? |
| 99 | - $this->trans->lang('%d / ', $limit) : |
|
| 100 | - "") . $this->trans->lang('%d row(s)', $numRows) : ""); |
|
| 99 | + $this->trans->lang('%d / ', $limit) : "") . $this->trans->lang('%d row(s)', $numRows) : ""); |
|
| 101 | 100 | } |
| 102 | 101 | |
| 103 | 102 | // Table header |
@@ -179,9 +178,7 @@ discard block |
||
| 179 | 178 | $timestamps = []; |
| 180 | 179 | // TODO: Move this to driver implementations |
| 181 | 180 | $parse = '[\'"' . |
| 182 | - ($this->driver->jush() == "sql" ? '`#' : |
|
| 183 | - ($this->driver->jush() == "sqlite" ? '`[' : |
|
| 184 | - ($this->driver->jush() == "mssql" ? '[' : ''))) . ']|/\*|-- |$' . |
|
| 181 | + ($this->driver->jush() == "sql" ? '`#' : ($this->driver->jush() == "sqlite" ? '`[' : ($this->driver->jush() == "mssql" ? '[' : ''))) . ']|/\*|-- |$' . |
|
| 185 | 182 | ($this->driver->jush() == "pgsql" ? '|\$[^$]*\$' : ''); |
| 186 | 183 | // $total_start = \microtime(true); |
| 187 | 184 | // \parse_str($_COOKIE["adminer_export"], $adminer_export); |
@@ -207,8 +204,7 @@ discard block |
||
| 207 | 204 | |
| 208 | 205 | if ($found && \rtrim($found) != $delimiter) { |
| 209 | 206 | // find matching quote or comment end |
| 210 | - while (\preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' : |
|
| 211 | - (\preg_match('~^-- |^#~', $found) ? "\n" : \preg_quote($found) . |
|
| 207 | + while (\preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' : (\preg_match('~^-- |^#~', $found) ? "\n" : \preg_quote($found) . |
|
| 212 | 208 | "|\\\\."))) . '|$)s', $queries, $match, PREG_OFFSET_CAPTURE, $offset)) { |
| 213 | 209 | //! respect sql_mode NO_BACKSLASH_ESCAPES |
| 214 | 210 | $s = $match[0][0]; |
@@ -303,7 +299,7 @@ discard block |
||
| 303 | 299 | if ($empty) { |
| 304 | 300 | $messages[] = $this->trans->lang('No commands to execute.'); |
| 305 | 301 | } elseif ($onlyErrors) { |
| 306 | - $messages[] = $this->trans->lang('%d query(s) executed OK.', $commands - \count($errors)); |
|
| 302 | + $messages[] = $this->trans->lang('%d query(s) executed OK.', $commands - \count($errors)); |
|
| 307 | 303 | // $timestamps[] = $this->trans->formatTime($total_start); |
| 308 | 304 | } |
| 309 | 305 | // elseif($errors && $commands > 1) |
@@ -517,9 +517,8 @@ discard block |
||
| 517 | 517 | \preg_match_all("~'((?:[^']|'')*)'~", $field->length, $matches); |
| 518 | 518 | foreach ($matches[1] as $i => $val) { |
| 519 | 519 | $val = \stripcslashes(\str_replace("''", "'", $val)); |
| 520 | - $checked = (\is_int($value) ? $value == $i + 1 : |
|
| 521 | - (\is_array($value) ? \in_array($i+1, $value) : $value === $val)); |
|
| 522 | - $inputs[] = "<label><input type='$type'$attrs value='" . ($i+1) . "'" . |
|
| 520 | + $checked = (\is_int($value) ? $value == $i + 1 : (\is_array($value) ? \in_array($i + 1, $value) : $value === $val)); |
|
| 521 | + $inputs[] = "<label><input type='$type'$attrs value='" . ($i + 1) . "'" . |
|
| 523 | 522 | ($checked ? ' checked' : '') . '>' . $this->html($this->editValue($val, $field)) . '</label>'; |
| 524 | 523 | } |
| 525 | 524 | |
@@ -583,8 +582,7 @@ discard block |
||
| 583 | 582 | } |
| 584 | 583 | $enumLength = $this->driver->enumLength(); |
| 585 | 584 | return (\preg_match("~^\\s*\\(?\\s*$enumLength(?:\\s*,\\s*$enumLength)*+\\s*\\)?\\s*\$~", $length) && |
| 586 | - \preg_match_all("~$enumLength~", $length, $matches) ? "(" . \implode(",", $matches[0]) . ")" : |
|
| 587 | - \preg_replace('~^[0-9].*~', '(\0)', \preg_replace('~[^-0-9,+()[\]]~', '', $length)) |
|
| 585 | + \preg_match_all("~$enumLength~", $length, $matches) ? "(" . \implode(",", $matches[0]) . ")" : \preg_replace('~^[0-9].*~', '(\0)', \preg_replace('~[^-0-9,+()[\]]~', '', $length)) |
|
| 588 | 586 | ); |
| 589 | 587 | } |
| 590 | 588 | |
@@ -755,7 +753,7 @@ discard block |
||
| 755 | 753 | $expressions = []; |
| 756 | 754 | foreach ($indexes as $i => $index) { |
| 757 | 755 | if ($index->type == "FULLTEXT" && $this->input->values["fulltext"][$i] != "") { |
| 758 | - $columns = \array_map(function ($column) { |
|
| 756 | + $columns = \array_map(function($column) { |
|
| 759 | 757 | return $this->driver->escapeId($column); |
| 760 | 758 | }, $index->columns); |
| 761 | 759 | $expressions[] = "MATCH (" . \implode(", ", $columns) . ") AGAINST (" . |
@@ -873,8 +871,7 @@ discard block |
||
| 873 | 871 | */ |
| 874 | 872 | private function _selectValue(string $value, string $link, string $type, string $original) |
| 875 | 873 | { |
| 876 | - $clause = ($value === null ? "<i>NULL</i>" : |
|
| 877 | - (\preg_match("~char|binary|boolean~", $type) && !\preg_match("~var~", $type) ? |
|
| 874 | + $clause = ($value === null ? "<i>NULL</i>" : (\preg_match("~char|binary|boolean~", $type) && !\preg_match("~var~", $type) ? |
|
| 878 | 875 | "<code>$value</code>" : $value)); |
| 879 | 876 | if (\preg_match('~blob|bytea|raw|file~', $type) && !$this->isUtf8($value)) { |
| 880 | 877 | $clause = "<i>" . $this->trans->lang('%d byte(s)', \strlen($original)) . "</i>"; |