Prevent issue with empty $disallowed_id removing (#692)

This commit is contained in:
Roman Kelesidis 2023-05-17 16:48:13 +07:00 committed by GitHub
commit 2f2df932c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,6 +38,7 @@ if (isset($_POST['add_name'])) {
} elseif (isset($_POST['delete_name'])) {
$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";
$result = DB()->sql_query($sql);
if (!$result) {
@ -48,6 +49,7 @@ if (isset($_POST['add_name'])) {
bb_die($message);
}
}
/**
* Grab the current list of disallowed usernames