Skip to content

Commit

Permalink
Silence errors from iconv_strlen()
Browse files Browse the repository at this point in the history
The return value of iconv_strlen() is checked, thus there is not need to have an error (E_NOTICE) when an illegal byte sequence is encountered in a file that is being checked.
  • Loading branch information
Willem Stuursma committed Jul 9, 2015
1 parent 84c1532 commit c791dc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CodeSniffer/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,7 @@ private static function _createPositionMap(&$tokens, $tokenizer, $eolChar, $enco
// There are no tabs in this content, or we aren't replacing them.
if ($checkEncoding === true) {
// Not using the default encoding, so take a bit more care.
$length = iconv_strlen($tokens[$i]['content'], $encoding);
$length = @iconv_strlen($tokens[$i]['content'], $encoding);
if ($length === false) {
// String contained invalid characters, so revert to default.
$length = strlen($tokens[$i]['content']);
Expand Down

0 comments on commit c791dc0

Please sign in to comment.