PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Bugfix: Cloudflare caching hides IP address

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

In storage.php

$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; //"91.196.221.50, 172.71.174.239"
$this->user_ip = filter_var($ip, FILTER_VALIDATE_IP);

the problem is that HTTP_X_FORWARDED_FOR contains a comma seperated IP, and FILTER_VALIDATE_IP says this is invalid.

Suggested Fix:
if(!empty($_SERVER['HTTP_X_REAL_IP'])){
    $ip = $_SERVER['HTTP_X_REAL_IP'];
    if($splitPos = strpos($ip, ',')) $ip = substr($ip, 0, $splitPos);
} else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    if($splitPos = strpos($ip, ',')) $ip = substr($ip, 0, $splitPos);
} elseif(isset($_SERVER['REMOTE_ADDR'])) {
    $ip = $_SERVER['REMOTE_ADDR'];
} else {
    $ip='';
}

Hello

thank you for your cooperation

I passed this on to the developers