Skip to content

Commit

Permalink
Merge pull request #1 from ocnk/master
Browse files Browse the repository at this point in the history
 #61151 removing bad detector js and css minimization
  • Loading branch information
mipxtx committed Jan 26, 2016
2 parents 28c2bb7 + 4a32714 commit fa74a53
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions CodeSniffer/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -1415,17 +1415,6 @@ public function getFilename()
*/
public static function tokenizeString($string, $tokenizer, $eolChar='\n', $tabWidth=null, $encoding=null)
{
// Minified files often have a very large number of characters per line
// and cause issues when tokenizing.
if (get_class($tokenizer) !== 'PHP_CodeSniffer_Tokenizers_PHP') {
$numChars = strlen($string);
$numLines = (substr_count($string, $eolChar) + 1);
$average = ($numChars / $numLines);
if ($average > 100) {
throw new PHP_CodeSniffer_Exception('File appears to be minified and cannot be processed');
}
}

$tokens = $tokenizer->tokenizeString($string, $eolChar);

if ($tabWidth === null) {
Expand Down

0 comments on commit fa74a53

Please sign in to comment.