Skip to content

Commit

Permalink
Fix for ipv4 client address containing a port number after a colon. S…
Browse files Browse the repository at this point in the history
…uspect this is an issue with IIS in general, though may be specific to Azure. May need to submit as bug to WP Core.
  • Loading branch information
patrickebates committed Jun 11, 2017
1 parent 2630d5e commit dba4ba6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wp-admin/includes/class-wp-community-events.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ public static function get_unsafe_client_ip() {
*/
$address_chain = explode( ',', $_SERVER[ $header ] );
$client_ip = trim( $address_chain[0] );
if ( (strlen($client_ip) < 25) && (stristr($client_ip, ":") !== FALSE) ) {
$client_ip = substr($client_ip, 0, strpos($client_ip, ":"));
}

break;
}
Expand Down

0 comments on commit dba4ba6

Please sign in to comment.