geoip_shop_manager.py aktualisiert
This commit is contained in:
@@ -10,7 +10,7 @@ Supports three modes:
|
||||
- php-only: GeoIP blocking without CrowdSec
|
||||
- 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
|
||||
@@ -155,7 +155,7 @@ def generate_php_countries_array(geo_region):
|
||||
def generate_php_bot_patterns():
|
||||
patterns = []
|
||||
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'")
|
||||
return ",\n ".join(patterns)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user