Remove swear filter & hashed ips
This commit is contained in:
1 parent
d7c602ecd2
commit
1f1c0053b7
6 files changed
+6
-101
No files matched your search
+1
-6
@@ -1,12 +1,7 @@
|
||||
<?php
|
||||
require __DIR__ . '/../composer/vendor/autoload.php';
|
||||
include __DIR__ . "/../config/captcha.php";
|
||||
include __DIR__ . "/../incl/db.php";
|
||||
|
||||
use Snipe\BanBuilder\CensorWords;
|
||||
|
||||
$censor = new CensorWords();
|
||||
|
||||
$conn = connectToDatabase();
|
||||
|
||||
$stmt = $conn->prepare("SELECT * FROM colors ORDER BY timestamp DESC");
|
||||
@@ -135,7 +130,7 @@ $lastInsertId = $_GET['highlight'] ?? null;
|
||||
foreach ($result as $row) {
|
||||
echo "<div class=\"named-color" . ($lastInsertId != null && $lastInsertId == $row['id'] && ($row['timestamp'] > time() - 10) ? " highlight" : "") . "\">";
|
||||
echo "<div class=\"color\" style=\"background: #" . $row['color'] . ";\"></div>";
|
||||
echo "<p>" . htmlspecialchars($censor->censorString(preg_replace('/[^a-zA-Z0-9\s\-\_]/', '', base64_decode($row['name'])))['clean']) . " • #" . $row["color"] . "</p>";
|
||||
echo "<p>" . htmlspecialchars(base64_decode($row['name'])) . " • #" . $row["color"] . "</p>";
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
|
||||
+1
-4
@@ -3,10 +3,8 @@ include __DIR__ . "/../config/captcha.php";
|
||||
include __DIR__ . "/../incl/db.php";
|
||||
|
||||
$time = time();
|
||||
$hostname = hash('sha256', $_SERVER["HTTP_CF_CONNECTING_IP"]);
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
|
||||
$ip = $_SERVER["HTTP_CF_CONNECTING_IP"];
|
||||
$token = $_POST['cf-turnstile-response'] ?? '';
|
||||
$url = 'https://challenges.cloudflare.com/turnstile/v0/siteverify';
|
||||
@@ -76,11 +74,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
exit;
|
||||
}
|
||||
|
||||
$stmt = $conn->prepare("INSERT INTO colors (color, name, timestamp, hostname) VALUES (:color, :name, :time, :hostname)");
|
||||
$stmt = $conn->prepare("INSERT INTO colors (color, name, timestamp) VALUES (:color, :name, :time)");
|
||||
$stmt->bindParam(':color', $color);
|
||||
$stmt->bindParam(':name', $name);
|
||||
$stmt->bindParam(':time', $time);
|
||||
$stmt->bindParam(':hostname', $hostname);
|
||||
$stmt->execute();
|
||||
$lastInsertId = $conn->lastInsertId();
|
||||
header("Location: /?highlight=$lastInsertId");
|
||||
|
||||
Reference in new issue
Block a user