Fixes issue #1815 - input::ip_address() returns incorrect IP behind proxy
diff --git a/system/core/Input.php b/system/core/Input.php
index 968a42a..5b8e623 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -383,7 +383,7 @@
 		if (strpos($this->ip_address, ',') !== FALSE)
 		{
 			$x = explode(',', $this->ip_address);
-			$this->ip_address = trim(end($x));
+			$this->ip_address = trim($x[0]);
 		}
 
 		if ( ! $this->valid_ip($this->ip_address))