summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-11-02 22:33:45 +0100
committerAndrey Andreev <narf@bofh.bg>2012-11-02 22:33:45 +0100
commite24eed7e4e410fabf7479a67d3a27e2596444505 (patch)
treeb751d0553e2a72dc0dbe909b3c7db1fc0d4d2f5c /system/core
parent533bf2dd5f36e277a9ee6629ccd667a32b05d154 (diff)
Some micro-optimizations
Diffstat (limited to 'system/core')
-rw-r--r--system/core/Input.php8
1 files changed, 2 insertions, 6 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index c6063a280..142e2b434 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -356,11 +356,7 @@ class CI_Input {
// Some proxies typically list the whole chain of IP
// addresses through which the client has reached us.
// e.g. client_ip, proxy_ip1, proxy_ip2, etc.
- if (strpos($spoof, ',') !== FALSE)
- {
- $spoof = explode(',', $spoof, 2);
- $spoof = $spoof[0];
- }
+ sscanf($spoof, '%[^,]', $spoof);
if ( ! $this->valid_ip($spoof))
{
@@ -430,7 +426,7 @@ class CI_Input {
}
// Split the netmask length off the network address
- list($netaddr, $masklen) = explode('/', $proxy_ips[$i], 2);
+ sscanf($proxy_ips[$i], '%[^/]/%d', $netaddr, $masklen);
// Again, an IPv6 address is most likely in a compressed form
if ($separator === ':')