Hi all,
for those have the same issue of same IP download in Azure I realised the fix:
Update the following function:
function sdm_get_ip_address( $ignore_private_and_reserved = false ) {
$flags = $ignore_private_and_reserved ? (FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) : 0;
foreach ( array( 'HTTP_CF_CONNECTING_IP', 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR' ) as $key ) {
if ( array_key_exists( $key, $_SERVER ) === true ) {
foreach ( explode( ',', $_SERVER[ $key ] ) as $ip ) {
$ip = trim( $ip ); // just to be safe
if ( !empty( $ip ) ) {
$parsed_url = parse_url( $ip );
$host = $parsed_url['host'];
if ( isset( $host ) ) {
if ( filter_var( $host, FILTER_VALIDATE_IP, $flags ) !== false ) {
return $host;
}
}
}
}
}
}
return null;
}
Now is working on my Azure WP installation.
Alberto
-
This reply was modified 5 years ago by
albertof.