BugBuster1701 / contao-botdetection-bundle

Contao 4/5 BotDetection Bundle
GNU Lesser General Public License v3.0
0 stars 1 forks source link

Get real visitor IP behind CloudFlare and other proxies #39

Closed BugBuster1701 closed 4 years ago

BugBuster1701 commented 4 years ago
$user_ip = (isset($_SERVER["HTTP_CF_CONNECTING_IP"]) ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER['REMOTE_ADDR']);

Validieren dann nicht vergessen filter_var FILTER_VALIDATE_IP

bzw. Test, ob es hier bereits implementiert ist: (Nö) https://github.com/contao/contao/blob/df942f20f591afd95ee3f8b8310f22ffc4edf60d/core-bundle/src/Resources/contao/library/Contao/Environment.php#L368