geoip_shop_manager.py aktualisiert

This commit is contained in:
2025-12-10 10:11:54 +01:00
parent 41a4a3dfd1
commit 3ebd1123a6

View File

@@ -10,7 +10,7 @@ Supports three modes:
- php-only: GeoIP blocking without CrowdSec - php-only: GeoIP blocking without CrowdSec
- bot-only: Rate-limit bots, shop remains globally accessible - bot-only: Rate-limit bots, shop remains globally accessible
v3.4.4: Rate-Limit 0 wird akzeptiert (= sofortiger Bot-Ban) v3.4.5: Fix regex delimiter escape für curl pattern
""" """
import os import os
@@ -155,7 +155,7 @@ def generate_php_countries_array(geo_region):
def generate_php_bot_patterns(): def generate_php_bot_patterns():
patterns = [] patterns = []
for bot_name, pattern in BOT_PATTERNS.items(): for bot_name, pattern in BOT_PATTERNS.items():
escaped_pattern = pattern.replace("'", "\\'") escaped_pattern = pattern.replace("'", "\\'").replace("/", "\\/")
patterns.append(f"'{bot_name}' => '/{escaped_pattern}/i'") patterns.append(f"'{bot_name}' => '/{escaped_pattern}/i'")
return ",\n ".join(patterns) return ",\n ".join(patterns)