Index: trunk/phase3/includes/IP.php |
— | — | @@ -541,11 +541,10 @@ |
542 | 542 | if ( self::isValid( $addr ) ) |
543 | 543 | return $addr; |
544 | 544 | |
545 | | - // Annoying IPv6 representations like ::ffff:1.2.3.4 |
| 545 | + // Turn mapped addresses from ::ce:ffff:1.2.3.4 to 1.2.3.4 |
546 | 546 | if ( strpos($addr,':') !==false && strpos($addr,'.') !==false ) { |
547 | | - $addr = str_replace( '.', ':', $addr ); |
548 | | - if( IP::isIPv6( $addr ) ) |
549 | | - return $addr; |
| 547 | + $addr = substr( $addr, strrpos($addr,':')+1 ); |
| 548 | + if( self::isIPv4($addr) ) return $addr; |
550 | 549 | } |
551 | 550 | |
552 | 551 | // IPv6 loopback address |