Index: index.php =================================================================== RCS file: /cvs/drupal/drupal/index.php,v retrieving revision 1.94 diff -u -p -r1.94 index.php --- index.php 26 Dec 2007 08:46:48 -0000 1.94 +++ index.php 10 Feb 2008 14:37:38 -0000 @@ -15,6 +15,9 @@ require_once './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); +// Do what ever to get the clients real IP address. +ip_address(true); + $return = menu_execute_active_handler(); // Menu status constants are integers; page content is a string. Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.206 diff -u -p -r1.206 bootstrap.inc --- includes/bootstrap.inc 10 Jan 2008 22:47:17 -0000 1.206 +++ includes/bootstrap.inc 10 Feb 2008 14:37:41 -0000 @@ -1113,12 +1113,20 @@ function language_default($property = NU * instead of $_SERVER['REMOTE_ADDR'], which would be the IP address * of the proxy server, and not the client's. * + * @param $force + * Optional property to clear cached IP address. * @return * IP address of client machine, adjusted for reverse proxy. */ -function ip_address() { +function ip_address($force = FALSE) { static $ip_address = NULL; + // Reset the $ip_address because if cache is enabled $ip_address + // will be available between requests. + if ($force) { + $ip_address = NULL; + } + if (!isset($ip_address)) { $ip_address = $_SERVER['REMOTE_ADDR']; if (variable_get('reverse_proxy', 0) && array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {