Alphabetize the blacklist

This commit is contained in:
2024-09-28 19:57:14 -07:00
parent daf1e7f4ef
commit 7ab2b59acd
2 changed files with 5 additions and 1 deletions

View File

@ -41,6 +41,7 @@ Also thanks to [LudoBoggio](https://github.com/LudoBoggio) for the [YourlsBlackl
---------
v0.06 Alphabetize the blacklist
v0.05 Fix all links being blocked
v0.04 Fix https and not both https and http blocking
v0.03 Fix some crap code (of mine)

View File

@ -3,7 +3,7 @@
Plugin Name: Better Yourls BlackList Domains
Plugin URI: https://git.oldgate.org/Sophia/better-yourls-blacklist-domains
Description: Plugin which disallows blacklisted domains and bans the submitter's IP address. GPL v3
Version: 0.05
Version: 0.06
Author: Sophia Atkinson
Author URI: https://sophia.wtf
Original Author: apelly
@ -110,6 +110,9 @@ function better_blacklist_process_form() {
// Sanitize and process the form input
$blacklist_form = array_filter( array_map( 'trim', explode( "\r\n", $_POST['blacklist_form'] ) ) );
// Alphabetize the blacklist
sort($blacklist_form, SORT_STRING | SORT_FLAG_CASE);
// Update the option with serialized data
yourls_update_option( 'better_blacklist_domain_list', serialize( $blacklist_form ) );