mirror of
https://github.com/vrana/adminer.git
synced 2025-08-06 14:46:36 +02:00
Fix errors discovered by tests
This commit is contained in:
@@ -233,7 +233,7 @@ if (support("partitioning")) {
|
|||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td><input name="partition_names[]" value="' . h($val) . '" autocapitalize="off">';
|
echo '<td><input name="partition_names[]" value="' . h($val) . '" autocapitalize="off">';
|
||||||
echo ($key == count($row["partition_names"]) - 1 ? script("qsl('input').oninput = partitionNameChange;") : '');
|
echo ($key == count($row["partition_names"]) - 1 ? script("qsl('input').oninput = partitionNameChange;") : '');
|
||||||
echo '<td><input name="partition_values[]" value="' . h($row["partition_values"][$key]) . '">';
|
echo '<td><input name="partition_values[]" value="' . h(idx($row["partition_values"], $key)) . '">';
|
||||||
}
|
}
|
||||||
echo "</table>\n</div></fieldset>\n";
|
echo "</table>\n</div></fieldset>\n";
|
||||||
}
|
}
|
||||||
|
@@ -385,7 +385,7 @@ if (isset($_GET["sqlite"])) {
|
|||||||
|
|
||||||
function drop_databases($databases) {
|
function drop_databases($databases) {
|
||||||
global $connection;
|
global $connection;
|
||||||
$connection->__construct(":memory:"); // to unlock file, doesn't work in PDO on Windows
|
$connection->connect(":memory:"); // to unlock file, doesn't work in PDO on Windows
|
||||||
foreach ($databases as $db) {
|
foreach ($databases as $db) {
|
||||||
if (!@unlink($db)) {
|
if (!@unlink($db)) {
|
||||||
$connection->error = lang('File exists.');
|
$connection->error = lang('File exists.');
|
||||||
@@ -400,7 +400,7 @@ if (isset($_GET["sqlite"])) {
|
|||||||
if (!check_sqlite_name($name)) {
|
if (!check_sqlite_name($name)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$connection->__construct(":memory:");
|
$connection->connect(":memory:");
|
||||||
$connection->error = lang('File exists.');
|
$connection->error = lang('File exists.');
|
||||||
return @rename(DB, $name);
|
return @rename(DB, $name);
|
||||||
}
|
}
|
||||||
|
@@ -385,7 +385,7 @@ class Adminer {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
$select[""] = array();
|
$select[""] = array();
|
||||||
foreach ($select as $key => $val) {
|
foreach ($select as $key => $val) {
|
||||||
$val = $_GET["columns"][$key];
|
$val = idx($_GET["columns"], $key, array());
|
||||||
$column = select_input(
|
$column = select_input(
|
||||||
" name='columns[$i][col]'",
|
" name='columns[$i][col]'",
|
||||||
$columns,
|
$columns,
|
||||||
@@ -879,7 +879,7 @@ class Adminer {
|
|||||||
$values = array();
|
$values = array();
|
||||||
foreach ($row as $val) {
|
foreach ($row as $val) {
|
||||||
$field = $result->fetch_field();
|
$field = $result->fetch_field();
|
||||||
if ($fields[$field->name]['generated']) {
|
if (idx($fields[$field->name], 'generated')) {
|
||||||
$generated[$field->name] = true;
|
$generated[$field->name] = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -139,7 +139,7 @@ foreach ($row["indexes"] as $index) {
|
|||||||
"partial(" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . ", '" . js_escape(JUSH == "sql" ? "" : $_GET["indexes"] . "_") . "')"
|
"partial(" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . ", '" . js_escape(JUSH == "sql" ? "" : $_GET["indexes"] . "_") . "')"
|
||||||
);
|
);
|
||||||
echo "<span class='idxopts" . ($show_options ? "" : " hidden") . "'>";
|
echo "<span class='idxopts" . ($show_options ? "" : " hidden") . "'>";
|
||||||
echo ($lengths ? "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h($index["lengths"][$key]) . "' title='" . lang('Length') . "'>" : "");
|
echo ($lengths ? "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h(idx($index["lengths"], $key)) . "' title='" . lang('Length') . "'>" : "");
|
||||||
echo (support("descidx") ? checkbox("indexes[$j][descs][$i]", 1, idx($index["descs"], $key), lang('descending')) : "");
|
echo (support("descidx") ? checkbox("indexes[$j][descs][$i]", 1, idx($index["descs"], $key), lang('descending')) : "");
|
||||||
echo "</span> </span>";
|
echo "</span> </span>";
|
||||||
$i++;
|
$i++;
|
||||||
|
@@ -145,7 +145,7 @@
|
|||||||
<table cellpadding="1" cellspacing="1" border="1">
|
<table cellpadding="1" cellspacing="1" border="1">
|
||||||
<thead><tr><td rowspan="1" colspan="3">Schema</td></tr></thead>
|
<thead><tr><td rowspan="1" colspan="3">Schema</td></tr></thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><td>open</td><td>/adminer/sqlite.php?sqlite=&username=ODBC&db=adminer_test&schema=</td><td></td></tr>
|
<tr><td>open</td><td>/adminer/sqlite.php?sqlite=&username=ODBC&db=adminer_test.sqlite&schema=</td><td></td></tr>
|
||||||
<tr><td>verifyTextPresent</td><td>Permanent link</td><td></td></tr>
|
<tr><td>verifyTextPresent</td><td>Permanent link</td><td></td></tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user