summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Email.php6
-rw-r--r--system/libraries/Trackback.php9
2 files changed, 11 insertions, 4 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 7d13a4645..93c19de5e 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -1544,7 +1544,7 @@ class CI_Email {
{
return mb_encode_mimeheader($str, $this->charset, 'Q', $this->crlf);
}
- elseif (extension_loaded('iconv'))
+ elseif (ICONV_ENABLED === TRUE)
{
$output = @iconv_mime_encode('', $str,
array(
@@ -1573,9 +1573,9 @@ class CI_Email {
isset($chars) OR $chars = strlen($str);
$output = '=?'.$this->charset.'?Q?';
- for ($i = 0, $length = strlen($output), $iconv = extension_loaded('iconv'); $i < $chars; $i++)
+ for ($i = 0, $length = strlen($output); $i < $chars; $i++)
{
- $chr = ($this->charset === 'UTF-8' && $iconv === TRUE)
+ $chr = ($this->charset === 'UTF-8' && ICONV_ENABLED === TRUE)
? '='.implode('=', str_split(strtoupper(bin2hex(iconv_substr($str, $i, 1, $this->charset))), 2))
: '='.strtoupper(bin2hex($str[$i]));
diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php
index 7bcb2aa21..9fa4a8edb 100644
--- a/system/libraries/Trackback.php
+++ b/system/libraries/Trackback.php
@@ -181,7 +181,14 @@ class CI_Trackback {
if ($val !== 'url' && MB_ENABLED === TRUE)
{
- $_POST[$val] = mb_convert_encoding($_POST[$val], $this->charset, $this->data['charset']);
+ if (MB_ENABLED === TRUE)
+ {
+ $_POST[$val] = mb_convert_encoding($_POST[$val], $this->charset, $this->data['charset']);
+ }
+ elseif (ICONV_ENABLED === TRUE)
+ {
+ $_POST[$val] = @iconv($this->data['charset'], $this->charset.'//IGNORE', $_POST[$val]);
+ }
}
$_POST[$val] = ($val !== 'url') ? $this->convert_xml(strip_tags($_POST[$val])) : strip_tags($_POST[$val]);