Make WordPress Core

Ticket #41083: 41083.0.diff

File 41083.0.diff, 817 bytes (added by jsonm, 7 years ago)

Updated code to strip the port before the address is used by inet_ functions.

  • src/wp-admin/includes/class-wp-community-events.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    257257                                 * trusted for authenticity, but we don't need to for this purpose.
    258258                                 */
    259259                                $address_chain = explode( ',', $_SERVER[ $header ] );
    260                                 $client_ip     = trim( $address_chain[0] );
     260                                $client_ip     = trim( $address_chain[0] ) . ':';
     261
     262                                // Strip port from IP so it can be used with inet_ functions.
     263                                $client_ip     = substr($client_ip, 0, strpos($client_ip, ":"));
    261264
    262265                                break;
    263266                        }