diff --git a/lib/jsmin.php b/lib/jsmin.php index d5139a1..050b7a4 100644 --- a/lib/jsmin.php +++ b/lib/jsmin.php @@ -12,7 +12,7 @@ * Permission is hereby granted to use this version of the library under the * same terms as jsmin.c, which has the following license: * - * -- + * -- * Copyright (c) 2002 Douglas Crockford (www.crockford.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy of @@ -34,14 +34,14 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. - * -- + * -- * * @package JSMin * @author Ryan Grove * @copyright 2002 Douglas Crockford (jsmin.c) * @copyright 2007 Ryan Grove (PHP port) * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 1.0.0 (2007-05-04) + * @version 1.1.0 (2007-06-01) * @link http://code.google.com/p/jsmin-php/ */ @@ -58,17 +58,17 @@ class JSMin { protected $output = array(); // -- Public Static Methods -------------------------------------------------- - + public static function minify($js) { $jsmin = new JSMin($js); - return $jsmin->jsmin(); + return $jsmin->min(); } // -- Public Instance Methods ------------------------------------------------ public function __construct($input) { - $this->input = $input; - $this->inputLength = strlen($input); + $this->input = str_replace("\r\n", "\n", $input); + $this->inputLength = strlen($this->input); } // -- Protected Instance Methods --------------------------------------------- @@ -164,7 +164,7 @@ class JSMin { return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1; } - protected function jsmin() { + protected function min() { $this->a = "\n"; $this->action(3);