Permalink
Browse files

fix typo for #18876, handle iconv failure

git-svn-id: http://svn.php.net/repository/pear/packages/Mail_Mime/trunk@317638 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
roojs committed Oct 3, 2011
1 parent 9b06f10 commit 2a3a0a547a032d849f6f6b5757b33827d659e331
Showing with 6 additions and 3 deletions.
  1. +6 −3 mimeDecode.php
View
@@ -729,7 +729,7 @@ function _boundarySplit($input, $boundary)
* @return string Decoded header value
* @access private
*/
- function _decodeHeader($input, $defaut_charset=false)
+ function _decodeHeader($input, $default_charset=false)
{
if (!$this->_decode_headers) {
return $input;
@@ -762,9 +762,12 @@ function _decodeHeader($input, $defaut_charset=false)
}
$input = str_replace($encoded, $text, $input);
}
- if ($defaut_charset && is_string($this->_decode_headers)) {
- $input = @iconv($charset, $this->_decode_headers, $input);
+
+ if ($default_charset && is_string($this->_decode_headers)) {
+ $conv = @iconv($charset, $this->_decode_headers, $input);
+ $input = ($conv === false) ? $input : $conv;
}
+
return $input;
}

0 comments on commit 2a3a0a5

Please sign in to comment.