Problem with a suggested fix using Proxy
-
Can you please add this to the next version?
If behind a proxy where the client port is set in the $_SERVER[‘HTTP_X_FORWARDED_FOR’] like XX.XX.XX.XX:1234 the parse_content does not resolve the correct ip, see this as a fix:
function parse_content( $content ) {
$ipAddress = $_SERVER[‘REMOTE_ADDR’];
#FIXXXXXX START
$_SERVER[‘HTTP_X_FORWARDED_FOR’] = explode(‘:’,$_SERVER[‘HTTP_X_FORWARDED_FOR’])[0];
#FIXXXXXX ENDif ( isset( $_SERVER[‘HTTP_X_FORWARDED_FOR’] ) && filter_var($_SERVER[‘HTTP_X_FORWARDED_FOR’], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6 ) ) {
$ipAddress = $_SERVER[‘HTTP_X_FORWARDED_FOR’];
}
- The topic ‘Problem with a suggested fix using Proxy’ is closed to new replies.