mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
Prevent issue with empty $disallowed_id removing (#692)
This commit is contained in:
parent
10d6fe320f
commit
2f2df932c0
1 changed files with 10 additions and 8 deletions
|
@ -38,6 +38,7 @@ if (isset($_POST['add_name'])) {
|
||||||
} elseif (isset($_POST['delete_name'])) {
|
} elseif (isset($_POST['delete_name'])) {
|
||||||
$disallowed_id = isset($_POST['disallowed_id']) ? (int)$_POST['disallowed_id'] : (int)$_GET['disallowed_id'];
|
$disallowed_id = isset($_POST['disallowed_id']) ? (int)$_POST['disallowed_id'] : (int)$_GET['disallowed_id'];
|
||||||
|
|
||||||
|
if (!empty($disallowed_id)) {
|
||||||
$sql = 'DELETE FROM ' . BB_DISALLOW . " WHERE disallow_id = $disallowed_id";
|
$sql = 'DELETE FROM ' . BB_DISALLOW . " WHERE disallow_id = $disallowed_id";
|
||||||
$result = DB()->sql_query($sql);
|
$result = DB()->sql_query($sql);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
|
@ -48,6 +49,7 @@ if (isset($_POST['add_name'])) {
|
||||||
|
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grab the current list of disallowed usernames
|
* Grab the current list of disallowed usernames
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue