diff options
author | Derek Jones <derek.jones@ellislab.com> | 2009-03-11 18:01:14 +0100 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2009-03-11 18:01:14 +0100 |
commit | 1322ec54289f09f7e176924902d5642f269aec48 (patch) | |
tree | 96df3c6bc3d27d3a494b67f9f855850d600e4323 /system | |
parent | 28e5c8fc0ed79017a67b896613698e98fa7da8b3 (diff) |
ereg eradication
Diffstat (limited to 'system')
-rw-r--r-- | system/helpers/date_helper.php | 2 | ||||
-rw-r--r-- | system/libraries/Image_lib.php | 8 | ||||
-rw-r--r-- | system/libraries/Trackback.php | 7 |
3 files changed, 7 insertions, 10 deletions
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index dbd7e0ecc..7f6073427 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -460,7 +460,7 @@ if ( ! function_exists('human_to_unix')) $hour = (strlen($ex['0']) == 1) ? '0'.$ex['0'] : $ex['0']; $min = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1']; - if (isset($ex['2']) AND ereg("[0-9]{1,2}", $ex['2'])) + if (isset($ex['2']) && preg_match('/[0-9]{1,2}/', $ex['2'])) { $sec = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2']; } diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 2896c9e07..1e1ae7db1 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -350,7 +350,7 @@ class CI_Image_lib { { $protocol = 'image_process_'.$this->image_library; - if (eregi("gd2$", $protocol)) + if (preg_match('/gd2$/i', $protocol)) { $protocol = 'image_process_gd'; } @@ -373,7 +373,7 @@ class CI_Image_lib { { $protocol = 'image_process_'.$this->image_library; - if (eregi("gd2$", $protocol)) + if (preg_match('/gd2$/i', $protocol)) { $protocol = 'image_process_gd'; } @@ -559,9 +559,9 @@ class CI_Image_lib { return FALSE; } - if ( ! eregi("convert$", $this->library_path)) + if ( ! preg_match("/convert$/i", $this->library_path)) { - if ( ! eregi("/$", $this->library_path)) $this->library_path .= "/"; + $this->library_path = rtrim($this->library_path, '/').'/'; $this->library_path .= 'convert'; } diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index 844e50364..d53f17fef 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -267,7 +267,7 @@ class CI_Trackback { } @fclose($fp); - if ( ! eregi("<error>0</error>", $this->response)) + if (stristr($this->response, '<error>0</error>') === FALSE) { $message = 'An unknown error was encountered'; @@ -370,10 +370,7 @@ class CI_Trackback { } else { - if (ereg("/$", $url)) - { - $url = substr($url, 0, -1); - } + $url = rtrim($url, '/'); $tb_array = explode('/', $url); $tb_id = $tb_array[count($tb_array)-1]; |