summaryrefslogtreecommitdiff
path: root/includes/ban.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/ban.inc')
-rw-r--r--includes/ban.inc15
1 files changed, 7 insertions, 8 deletions
diff --git a/includes/ban.inc b/includes/ban.inc
index 618b275ec..e1b05fc1d 100644
--- a/includes/ban.inc
+++ b/includes/ban.inc
@@ -10,10 +10,9 @@ $index2type = array(0x01 => "addresses",
0x03 => "hostnames",
0x04 => "usernames");
-
function ban_match($mask, $category) {
// Perform query:
- $result = db_query("SELECT * FROM bans WHERE type = $category AND LOWER('$mask') LIKE LOWER(mask)");
+ $result = db_query("SELECT * FROM bans WHERE type = '$category' AND LOWER('$mask') LIKE LOWER(mask)");
// Return result:
return db_fetch_object($result);
@@ -25,29 +24,29 @@ function ban_add($mask, $category, $reason, $message = "") {
if (empty($mask)) {
$message = "failed: empty banmasks are not allowed.<P>\n";
}
- else if ($ban = db_fetch_object(db_query("SELECT * FROM bans WHERE type = $category AND '$mask' LIKE mask"))) {
+ else if ($ban = db_fetch_object(db_query("SELECT * FROM bans WHERE type = '$category' AND '$mask' LIKE mask"))) {
$message = "failed: ban is already matched by '$ban->mask'.<P>\n";
}
else {
$result = db_query("INSERT INTO bans (mask, type, reason, timestamp) VALUES ('$mask', '$category', '$reason', '". time() ."')");
- $message = "added new ban with mask `$mask'.<P>\n";
+ $message = "added new ban with mask '$mask'.<P>\n";
// Add log entry:
- watchdog("message", "added new ban `$mask' to category `". $index2type[$category] ."' with reason `$reason'.");
+ watchdog("message", "added new ban '$mask' to category '". $index2type[$category] ."' with reason '$reason'.");
}
}
function ban_delete($id) {
global $index2type;
- $result = db_query("SELECT * FROM bans WHERE id = $id");
+ $result = db_query("SELECT * FROM bans WHERE id = '$id'");
if ($ban = db_fetch_object($result)) {
// Perform query:
- $result = db_query("DELETE FROM bans WHERE id = $id");
+ $result = db_query("DELETE FROM bans WHERE id = '$id'");
// Deleted log entry:
- watchdog("message", "removed ban `$ban->mask' from category `". $index2type[$ban->type] ."'.");
+ watchdog("message", "removed ban '$ban->mask' from category '". $index2type[$ban->type] ."'.");
}
}