From 5b9fd2deb29968fd5f7b039868d95ce9c1392de5 Mon Sep 17 00:00:00 2001 From: tiyowan Date: Mon, 12 Mar 2012 20:26:59 +0400 Subject: Replace function_exists() checks with MB_ENABLED constant --- system/libraries/Form_validation.php | 8 ++++---- system/libraries/Trackback.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'system/libraries') diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 826d94fb0..9491f354c 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -72,7 +72,7 @@ class CI_Form_validation { $this->CI->load->helper('form'); // Set the character encoding in MB. - if (function_exists('mb_internal_encoding')) + if (MB_ENABLED === TRUE) { mb_internal_encoding($this->CI->config->item('charset')); } @@ -950,7 +950,7 @@ class CI_Form_validation { return FALSE; } - if (function_exists('mb_strlen')) + if (MB_ENABLED === TRUE) { return ! (mb_strlen($str) < $val); } @@ -974,7 +974,7 @@ class CI_Form_validation { return FALSE; } - if (function_exists('mb_strlen')) + if (MB_ENABLED === TRUE) { return ! (mb_strlen($str) > $val); } @@ -998,7 +998,7 @@ class CI_Form_validation { return FALSE; } - if (function_exists('mb_strlen')) + if (MB_ENABLED === TRUE) { return (mb_strlen($str) == $val); } diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index 3bea5f9b8..be1de6f3f 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -141,7 +141,7 @@ class CI_Trackback { $this->data['charset'] = ( ! isset($_POST['charset'])) ? 'auto' : strtoupper(trim($_POST['charset'])); - if ($val != 'url' && function_exists('mb_convert_encoding')) + if ($val != 'url' && MB_ENABLED === TRUE) { $_POST[$val] = mb_convert_encoding($_POST[$val], $this->charset, $this->data['charset']); } -- cgit v1.2.3-24-g4f1b