Skip to content

Commit

Permalink
- fix JSqueeze not counting chars in regexp and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Aug 29, 2012
1 parent 1b1c001 commit dd1f81d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,13 @@ protected function makeVars($closure, &$tree, $key)
}
}

if ($this->specialVarRx && preg_match_all("#//''\"\"[0-9]+'#", $closure, $w)) foreach ($w[0] as $a)
if (preg_match_all("#//''\"\"[0-9]+(?:['!]|/')#", $closure, $w)) foreach ($w[0] as $a)
{
$v = preg_split("#([.,{]?(?<![a-zA-Z0-9_\$@]){$this->specialVarRx}:?)#", $this->strings[$a], -1, PREG_SPLIT_DELIM_CAPTURE);
$v = "'" === substr($a, -1) && "/'" !== substr($a, -2) && $this->specialVarRx
? preg_split("#([.,{]?(?<![a-zA-Z0-9_\$@]){$this->specialVarRx}:?)#", $this->strings[$a], -1, PREG_SPLIT_DELIM_CAPTURE)
: array($this->strings[$a]);
$a = count($v);

for ($i = 0; $i < $a; ++$i)
{
$k = $v[$i];
Expand Down Expand Up @@ -799,7 +802,7 @@ protected function renameVars(&$tree, $root)

if ('' === $this->str0)
{
$this->str0 = 'CLASPEMITDBFRUGNJVHOWKXQYZclaspemitdbfrugnjvhowkxqyz';
$this->str0 = 'claspemitdbfrugnjvhowkxqyzCLASPEMITDBFRUGNJVHOWKXQYZ';
$this->str1 = $this->str0 . '0123456789';
}

Expand Down

0 comments on commit dd1f81d

Please sign in to comment.