1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Update IP address table

This commit is contained in:
e107steved
2007-02-14 22:15:46 +00:00
parent 77dcf4db3d
commit 3b3e8f2a6a

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $
| $Revision: 1.1.1.1 $ | $Revision: 1.2 $
| $Date: 2006-12-02 04:33:43 $ | $Date: 2007-02-14 22:15:34 $
| $Author: mcfly_e107 $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -169,14 +169,13 @@ class e107{
if (getenv('HTTP_X_FORWARDED_FOR')) { if (getenv('HTTP_X_FORWARDED_FOR')) {
$ip=$_SERVER['REMOTE_ADDR']; $ip=$_SERVER['REMOTE_ADDR'];
if (preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", getenv('HTTP_X_FORWARDED_FOR'), $ip3)) { if (preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", getenv('HTTP_X_FORWARDED_FOR'), $ip3)) {
$ip2 = array( $ip2 = array('#^0\..*#',
'/^0\./', '#^127\..*#', // Local loopbacks
'/^127\.0\.0\.1/', '#^192\.168\..*#', // RFC1918 - Private Network
'/^192\.168\..*/', '#^172\.(?:1[6789]|2\d|3[01])\..*#', // RFC1918 - Private network
'/^172\.16\..*/', '#^10\..*#', // RFC1918 - Private Network
'/^10..*/', '#^169\.254\..*#', // RFC3330 - Link-local, auto-DHCP
'/^224..*/', '#^2(?:2[456789]|[345][0-9])\..*#' // Single check for Class D and Class E
'/^240..*/'
); );
$ip = preg_replace($ip2, $ip, $ip3[1]); $ip = preg_replace($ip2, $ip, $ip3[1]);
} }