Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'fabpot/fix/escaper'
Browse files Browse the repository at this point in the history
  • Loading branch information
akrabat committed Jun 27, 2012
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Escaper.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,17 +366,18 @@ protected function convertEncoding($string, $to, $from)
$result = iconv($from, $to, $string);
} elseif (function_exists('mb_convert_encoding')) {
$result = mb_convert_encoding($string, $to, $from);
} else {
throw new Exception\RuntimeException(
get_called_class()
. ' requires either the iconv or mbstring extension to be installed'
. ' when escaping for non UTF-8 strings.'
);
}
if ($result === false) {
return ''; // return non-fatal blank string on encoding errors from users
} else {
return $result;
}
throw new Exception\RuntimeException(
get_called_class()
. ' requires either the iconv or mbstring extension to be installed'
. ' when escaping for non UTF-8 strings.'
);
}

/**
Expand Down

0 comments on commit ca7499b

Please sign in to comment.