Index: trunk/phase3/includes/ProxyTools.php |
— | — | @@ -76,13 +76,14 @@ |
77 | 77 | |
78 | 78 | /* collect the originating ips */ |
79 | 79 | # Client connecting to this webserver |
80 | | - if ( isset( $_SERVER['REMOTE_ADDR'] ) && IP::canonicalize( $_SERVER['REMOTE_ADDR'] ) ) { |
81 | | - $ipchain = array( IP::canonicalize( $_SERVER['REMOTE_ADDR'] ) ); |
82 | | - } else { |
83 | | - # Running on CLI or REMOTE_ADDR is broken |
84 | | - $ipchain = array( '127.0.0.1' ); |
| 80 | + if ( isset( $_SERVER['REMOTE_ADDR'] ) ) { |
| 81 | + $ip = IP::canonicalize( $_SERVER['REMOTE_ADDR'] ); |
85 | 82 | } |
86 | | - $ip = $ipchain[0]; |
| 83 | + if( $ip ) { |
| 84 | + $ipchain[] = $ip; |
| 85 | + } |
| 86 | + |
| 87 | + $ip = false; |
87 | 88 | |
88 | 89 | # Append XFF on to $ipchain |
89 | 90 | $forwardedFor = wfGetForwardedFor(); |
— | — | @@ -107,6 +108,10 @@ |
108 | 109 | } |
109 | 110 | } |
110 | 111 | |
| 112 | + if( $ip ) { |
| 113 | + throw new MWException( "Unable to determine IP" ); |
| 114 | + } |
| 115 | + |
111 | 116 | wfDebug( "IP: $ip\n" ); |
112 | 117 | $wgIP = $ip; |
113 | 118 | return $ip; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -182,8 +182,7 @@ |
183 | 183 | * Multiple whitespace in TOC anchors is now stripped, for consistency with the |
184 | 184 | link from the edit comment |
185 | 185 | * (bug 19112) Preferences now respects $wgUseExternalEditor, $wgExternalDiffEngine |
186 | | -* (bug 18173) Login form exception on malformed REMOTE_ADDR, wfGetIP() now falls |
187 | | - back to 127.0.0.1 if the IP cannot be determined |
| 186 | +* (bug 18173) MediaWiki now fails on malformed REMOTE_ADDR |
188 | 187 | |
189 | 188 | == API changes in 1.16 == |
190 | 189 | |