From 1322ec54289f09f7e176924902d5642f269aec48 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 11 Mar 2009 17:01:14 +0000 Subject: ereg eradication --- system/libraries/Image_lib.php | 8 ++++---- system/libraries/Trackback.php | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'system/libraries') 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("0", $this->response)) + if (stristr($this->response, '0') === 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]; -- cgit v1.2.3-24-g4f1b