Skip to content

Commit

Permalink
Skip non-js script blocks in JavascriptCompressor
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Chitolina committed May 27, 2015
1 parent ab05fa0 commit 8ed5631
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Kcs/CompressorBundle/Compressor/JavascriptCompressor.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,7 @@ public function onPreProcess(CompressionEvent $event)
// Find all occourrences of block pattern on response content
if (preg_match_all($this->getPattern(), $html, $matches)) {
foreach($matches[0] as $k => $content) {
$type = $this->getTypeAttr($matches[1][$k]);

// Ignore jQuery template. Should be compressed with the rest of html.
if ($type !== "text/x-jquery-tmpl") {
if ($this->isJavascript($matches[1][$k])) {
// Save found block
$this->blocks[$k] = $content;

Expand Down

0 comments on commit 8ed5631

Please sign in to comment.