From 1f1c0053b738236bd86f72237483300e19ef2d61 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Sun, 4 May 2025 10:28:16 -0700 Subject: [PATCH] Remove swear filter & hashed ips --- composer/.gitignore | 6 ---- composer/composer.json | 5 --- composer/composer.lock | 71 ------------------------------------------ database.sql | 13 +++----- webroot/index.php | 7 +---- webroot/upload.php | 5 +-- 6 files changed, 6 insertions(+), 101 deletions(-) delete mode 100644 composer/.gitignore delete mode 100644 composer/composer.json delete mode 100644 composer/composer.lock diff --git a/composer/.gitignore b/composer/.gitignore deleted file mode 100644 index 23a42ca..0000000 --- a/composer/.gitignore +++ /dev/null @@ -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 \ No newline at end of file diff --git a/composer/composer.json b/composer/composer.json deleted file mode 100644 index 458a931..0000000 --- a/composer/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require": { - "snipe/banbuilder": "^2.3" - } -} diff --git a/composer/composer.lock b/composer/composer.lock deleted file mode 100644 index 4e7e222..0000000 --- a/composer/composer.lock +++ /dev/null @@ -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" -} diff --git a/database.sql b/database.sql index a522e38..273394b 100644 --- a/database.sql +++ b/database.sql @@ -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` -- diff --git a/webroot/index.php b/webroot/index.php index 5527571..4bc8c6b 100644 --- a/webroot/index.php +++ b/webroot/index.php @@ -1,12 +1,7 @@ prepare("SELECT * FROM colors ORDER BY timestamp DESC"); @@ -135,7 +130,7 @@ $lastInsertId = $_GET['highlight'] ?? null; foreach ($result as $row) { echo "
time() - 10) ? " highlight" : "") . "\">"; echo "
"; - echo "

" . htmlspecialchars($censor->censorString(preg_replace('/[^a-zA-Z0-9\s\-\_]/', '', base64_decode($row['name'])))['clean']) . " • #" . $row["color"] . "

"; + echo "

" . htmlspecialchars(base64_decode($row['name'])) . " • #" . $row["color"] . "

"; echo "
"; } ?> diff --git a/webroot/upload.php b/webroot/upload.php index a620abe..3ce6f43 100644 --- a/webroot/upload.php +++ b/webroot/upload.php @@ -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");