diff options
author | dchill42 <dchill42@gmail.com> | 2012-10-12 22:26:12 +0200 |
---|---|---|
committer | dchill42 <dchill42@gmail.com> | 2012-10-12 22:26:12 +0200 |
commit | 93ec20b8d9afbf8cb22ec6383b7fb24fe70330e8 (patch) | |
tree | 8ad006bb39a8caee805fb9dd35912b32fc2d9778 /system/libraries | |
parent | 7ecc5cda6647a4b316b44dc40d5925d9ef63c908 (diff) | |
parent | 98ebf4351f8aad58504cd7318ddd94faf0dec482 (diff) |
Merge branch 'develop' of github.com:/EllisLab/CodeIgniter into load_config_units
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Email.php | 13 | ||||
-rw-r--r-- | system/libraries/Encrypt.php | 2 | ||||
-rw-r--r-- | system/libraries/Form_validation.php | 20 |
3 files changed, 26 insertions, 9 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 1b457aee4..fa1d5e9bf 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -98,6 +98,8 @@ class CI_Email { */ public function __construct($config = array()) { + $this->charset = strtoupper(config_item('charset')); + if (count($config) > 0) { $this->initialize($config); @@ -1107,9 +1109,16 @@ class CI_Email { // However, many developers choose to override that and violate // the RFC rules due to (apparently) a bug in MS Exchange, // which only works with "\n". - if ($this->crlf === "\r\n" && is_php('5.3')) + if ($this->crlf === "\r\n") { - return quoted_printable_encode($str); + if (is_php('5.3')) + { + return quoted_printable_encode($str); + } + elseif (function_exists('imap_8bit')) + { + return imap_8bit($str); + } } // Reduce multiple spaces & remove nulls diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index 679609251..73ab8ca7d 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -165,7 +165,7 @@ class CI_Encrypt { */ public function decode($string, $key = '') { - if (preg_match('/[^a-zA-Z0-9\/\+=]/', $string)) + if (preg_match('/[^a-zA-Z0-9\/\+=]/', $string) OR base64_encode(base64_decode($string)) !== $string) { return FALSE; } diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index b490a34ca..91f46b6de 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -134,12 +134,6 @@ class CI_Form_validation { // Automatically load the form helper $this->CI->load->helper('form'); - // Set the character encoding in MB. - if (MB_ENABLED === TRUE) - { - mb_internal_encoding($this->CI->config->item('charset')); - } - log_message('debug', 'Form Validation Class Initialized'); } @@ -977,6 +971,20 @@ class CI_Form_validation { // -------------------------------------------------------------------- /** + * Differs from another field + * + * @param string + * @param string field + * @return bool + */ + public function differs($str, $field) + { + return ! (isset($this->_field_data[$field]) && $this->_field_data[$field]['postdata'] === $str); + } + + // -------------------------------------------------------------------- + + /** * Is Unique * * Check if the input value doesn't already exist |