diff --git a/library/vendor/JShrink/Minifier.php b/library/vendor/JShrink/Minifier.php index 76f4ced69..ad8157f17 100644 --- a/library/vendor/JShrink/Minifier.php +++ b/library/vendor/JShrink/Minifier.php @@ -183,7 +183,7 @@ class Minifier // new lines case "\n": // if the next line is something that can't stand alone preserve the newline - if (strpos('(-+[@', $this->b) !== false) { + if ($this->b !== false && strpos('(-+[@', $this->b) !== false) { echo $this->a; $this->saveString(); break; @@ -231,7 +231,7 @@ class Minifier // check for some regex that breaks stuff if ($this->a === '/' && ($this->b === '\'' || $this->b === '"')) { $this->saveRegex(); - continue; + continue 3; } echo $this->a; @@ -274,9 +274,8 @@ class Minifier if (isset($this->c)) { $char = $this->c; unset($this->c); - - // Otherwise we start pulling from the input. } else { + // Otherwise we start pulling from the input. $char = substr($this->input, $this->index, 1); // If the next character doesn't exist return false. @@ -459,11 +458,8 @@ class Minifier echo $this->a; // Loop until the string is done - while (true) { - - // Grab the very next character and load it into a - $this->a = $this->getChar(); - + // Grab the very next character and load it into a + while (($this->a = $this->getChar()) !== false) { switch ($this->a) { // If the string opener (single or double quote) is used diff --git a/library/vendor/JShrink/SOURCE b/library/vendor/JShrink/SOURCE index 46fe41d30..a236ec215 100644 --- a/library/vendor/JShrink/SOURCE +++ b/library/vendor/JShrink/SOURCE @@ -1,4 +1,7 @@ -curl https://codeload.github.com/tedious/JShrink/tar.gz/v1.3.0 -o JShrink-1.3.0.tar.gz -tar xzf JShrink-1.3.0.tar.gz --strip-components 1 JShrink-1.3.0/LICENSE -tar xzf JShrink-1.3.0.tar.gz --strip-components 3 JShrink-1.3.0/src/JShrink/Minifier.php -rm JShrink-1.3.0.tar.gz +#!/bin/bash +set -eux +VERSION=1.3.1 +curl -LsS https://github.com/tedious/JShrink/archive/v"$VERSION".tar.gz -o /tmp/JShrink.tar.gz +tar xzf /tmp/JShrink.tar.gz --strip-components 1 JShrink-"$VERSION"/LICENSE +tar xzf /tmp/JShrink.tar.gz --strip-components 3 JShrink-"$VERSION"/src/JShrink/Minifier.php +rm /tmp/JShrink.tar.gz