From 76b369e191f4432ceba51ba7d7993c4ea54579ae Mon Sep 17 00:00:00 2001 From: Robin Sowell Date: Fri, 19 Mar 2010 11:15:28 -0400 Subject: Changed a few strstr to strpos for consistency w performance guidelines and to mirror EE2. --- system/core/Input.php | 2 +- system/helpers/download_helper.php | 2 +- system/libraries/Email.php | 2 +- system/libraries/Trackback.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system/core/Input.php b/system/core/Input.php index 0760dc830..2eef82458 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -288,7 +288,7 @@ class CI_Input { return $this->ip_address; } - if (strstr($this->ip_address, ',')) + if (strpos($this->ip_address, ',') !== FALSE) { $x = explode(',', $this->ip_address); $this->ip_address = trim(end($x)); diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 638ebaa88..eac024fcb 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -71,7 +71,7 @@ if ( ! function_exists('force_download')) } // Generate the server headers - if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) + if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== FALSE) { header('Content-Type: "'.$mime.'"'); header('Content-Disposition: attachment; filename="'.$filename.'"'); diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 8014bd21e..09d1b8fb9 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1865,7 +1865,7 @@ class CI_Email { elseif ($cip) $this->_IP = $cip; elseif ($fip) $this->_IP = $fip; - if (strstr($this->_IP, ',')) + if (strpos($this->_IP, ',') !== FALSE) { $x = explode(',', $this->_IP); $this->_IP = end($x); diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index a604c0b2d..a27914487 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -356,7 +356,7 @@ class CI_Trackback { { $tb_id = ""; - if (strstr($url, '?')) + if (strpos($url, '?') !== FALSE) { $tb_array = explode('/', $url); $tb_end = $tb_array[count($tb_array)-1]; -- cgit v1.2.3-24-g4f1b