mirror of
https://github.com/vrana/adminer.git
synced 2025-08-11 09:04:02 +02:00
added filter_input()
added `filter_input()` accessing superglobals var
This commit is contained in:
@@ -17,37 +17,39 @@ class AdminerFkDisable
|
|||||||
return $this->deleteAllBetween($beginning, $end, str_replace($textToDelete, '', $string)); // recursion to ensure all occurrences are replaced
|
return $this->deleteAllBetween($beginning, $end, str_replace($textToDelete, '', $string)); // recursion to ensure all occurrences are replaced
|
||||||
}
|
}
|
||||||
|
|
||||||
public function head(){
|
public function head(){
|
||||||
if (!isset($_GET['sql'])) {
|
$sql = filter_input(INPUT_GET, 'sql');
|
||||||
return;
|
if (!isset($sql)) {
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$query = trim($_POST['query']);
|
$query = trim(filter_input(INPUT_POST, 'query'));
|
||||||
|
|
||||||
if($_POST['fk_disable']){
|
if(filter_input(INPUT_POST, 'fk_disable')){
|
||||||
if($query) {
|
if($query) {
|
||||||
$query = trim($this->deleteAllBetween("-- FK:D0", "-- FK:D1", $query));
|
$query = trim($this->deleteAllBetween("-- FK:D0", "-- FK:D1", $query));
|
||||||
$_POST['query'] = "-- FK:D0\nSET FOREIGN_KEY_CHECKS=0;\n-- FK:D1\n\n{$query}\n\n-- FK:D0\nSET FOREIGN_KEY_CHECKS=1;\n-- FK:D1";
|
|
||||||
|
$_POST['query'] = "-- FK:D0\nSET FOREIGN_KEY_CHECKS=0;\n-- FK:D1\n\n{$query}\n\n-- FK:D0\n;SET FOREIGN_KEY_CHECKS=1;\n-- FK:D1";
|
||||||
}
|
}
|
||||||
$fk_disable_checked = ($_POST['fk_disable']) ? 'checked="checked"' : "";
|
$fk_disable_checked = ($_POST['fk_disable']) ? 'checked="checked"' : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script<?php echo nonce();?> type="text/javascript">
|
<script<?php echo nonce();?> type="text/javascript">
|
||||||
|
|
||||||
function domReady(fn) {
|
function domReady(fn) {
|
||||||
document.addEventListener("DOMContentLoaded", fn);
|
document.addEventListener("DOMContentLoaded", fn);
|
||||||
if (document.readyState === "interactive" || document.readyState === "complete" ) {
|
if (document.readyState === "interactive" || document.readyState === "complete" ) {
|
||||||
fn();
|
fn();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
domReady(() => {
|
domReady(() => {
|
||||||
document.querySelectorAll('#form p')[1].insertAdjacentHTML('beforeend', '<label><input type="checkbox" name="fk_disable" value="1" <?= $fk_disable_checked ?> /><?= h('Disable Foreign Keys') ?></label>')
|
document.querySelectorAll('#form p')[1].insertAdjacentHTML('beforeend', '<label><input type="checkbox" name="fk_disable" value="1" <?= $fk_disable_checked ?> /><?= h('Disable Foreign Keys') ?></label>')
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user