From fe06b4ccd8faa23ebc2b67147fc9064b785a675b Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 2 Jul 2008 20:05:11 +0000 Subject: - Patch #276581 by catch: wrote missing tests for contact module and simplified contact module thanks to that. Also removed some whitespace. --- includes/bootstrap.inc | 2 +- includes/tests/bootstrap.test | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'includes') diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 89e515369..fc7743989 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -1160,7 +1160,7 @@ function language_default($property = NULL) { /** * If Drupal is behind a reverse proxy, we use the X-Forwarded-For header - * instead of $_SERVER['REMOTE_ADDR'], which would be the IP address of + * instead of $_SERVER['REMOTE_ADDR'], which would be the IP address of * the proxy server, and not the client's. If Drupal is run in a cluster * we use the X-Cluster-Client-Ip header instead. * diff --git a/includes/tests/bootstrap.test b/includes/tests/bootstrap.test index beb94edf0..4b2cf3089 100644 --- a/includes/tests/bootstrap.test +++ b/includes/tests/bootstrap.test @@ -24,14 +24,14 @@ class BootstrapIPAddressTestCase extends DrupalWebTestCase { $this->forwarded_ip = '127.0.0.3'; $this->cluster_ip = '127.0.0.4'; $this->untrusted_ip = '0.0.0.0'; - + $_SERVER['REMOTE_ADDR'] = $this->remote_ip; unset($_SERVER['HTTP_X_FORWARDED_FOR']); unset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']); - + parent::setUp(); } - + /** * Implementation of tearDown(). */ @@ -49,14 +49,14 @@ class BootstrapIPAddressTestCase extends DrupalWebTestCase { ip_address(true) == $this->remote_ip, t('Got remote IP address') ); - + // Proxy forwarding on but no proxy addresses defined. variable_set('reverse_proxy', 1); $this->assertTrue( ip_address(true) == $this->remote_ip, t('Proxy forwarding without trusted proxies got remote IP address') ); - + // Proxy forwarding on and proxy address not trusted. variable_set('reverse_proxy_addresses', array($this->proxy_ip)); $_SERVER['REMOTE_ADDR'] = $this->untrusted_ip; @@ -71,8 +71,8 @@ class BootstrapIPAddressTestCase extends DrupalWebTestCase { $this->assertTrue( ip_address(true) == $this->forwarded_ip, t('Proxy forwarding with trusted proxy got forwarded IP address') - ); - + ); + // Cluster environment. $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'] = $this->cluster_ip; $this->assertTrue( -- cgit v1.2.3