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 +0,0 @@
|
||||
composer.phar
|
||||
/vendor/
|
||||
|
||||
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
|
||||
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
|
||||
# composer.lock
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"require": {
|
||||
"snipe/banbuilder": "^2.3"
|
||||
}
|
||||
}
|
||||
Generated
-71
@@ -1,71 +0,0 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "e653e00fe19eda8ebe60d0b64a2d3c46",
|
||||
"packages": [
|
||||
{
|
||||
"name": "snipe/banbuilder",
|
||||
"version": "2.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/snipe/banbuilder.git",
|
||||
"reference": "621d6d857400983d0fd6cd291f105a835a317748"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/snipe/banbuilder/zipball/621d6d857400983d0fd6cd291f105a835a317748",
|
||||
"reference": "621d6d857400983d0fd6cd291f105a835a317748",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^5.7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Snipe\\BanBuilder\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"AGPL-3.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "snipe",
|
||||
"email": "snipe@snipe.net",
|
||||
"role": "Creator & Developer"
|
||||
}
|
||||
],
|
||||
"description": "Library to easily handle profanity filtering in PHP projects.",
|
||||
"homepage": "http://banbuilder.com",
|
||||
"keywords": [
|
||||
"filter",
|
||||
"language",
|
||||
"profanity",
|
||||
"strings",
|
||||
"swear"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/snipe/banbuilder/issues",
|
||||
"source": "https://github.com/snipe/banbuilder/tree/2.3.0"
|
||||
},
|
||||
"time": "2018-08-30T22:45:56+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": {},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {},
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
||||
+4
-9
@@ -2,9 +2,9 @@
|
||||
-- version 5.2.2
|
||||
-- https://www.phpmyadmin.net/
|
||||
--
|
||||
-- Host: 127.0.0.1:3306
|
||||
-- Generation Time: Mar 08, 2025 at 05:27 PM
|
||||
-- Server version: 11.4.3-MariaDB-1
|
||||
-- Host: 127.0.0.1
|
||||
-- Generation Time: May 04, 2025 at 05:27 PM
|
||||
-- Server version: 11.4.5-MariaDB-0ubuntu0.24.10.1
|
||||
-- PHP Version: 8.3.11
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
@@ -31,14 +31,9 @@ CREATE TABLE `colors` (
|
||||
`id` int(11) NOT NULL,
|
||||
`name` text NOT NULL,
|
||||
`color` char(6) NOT NULL,
|
||||
`timestamp` int(11) NOT NULL,
|
||||
`hostname` char(64) DEFAULT NULL
|
||||
`timestamp` int(11) NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;
|
||||
|
||||
--
|
||||
-- Indexes for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- Indexes for table `colors`
|
||||
--
|
||||
|
||||
+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