Resolved bug 26791 by replacing JSMin with a new library called JavaScriptDistiller...
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoader.php
index 11bfdaa..ba5ae11 100644 (file)
@@ -108,7 +108,7 @@ class ResourceLoader {
         * Runs JavaScript or CSS data through a filter, caching the filtered result for future calls.
         * 
         * Available filters are:
-        *  - minify-js \see JSMin::minify
+        *  - minify-js \see JavaScriptDistiller::stripWhiteSpace
         *  - minify-css \see CSSMin::minify
         * 
         * If $data is empty, only contains whitespace or the filter was unknown, 
@@ -119,6 +119,8 @@ class ResourceLoader {
         * @return String: Filtered data, or a comment containing an error message
         */
        protected function filter( $filter, $data ) {
+               global $wgResourceLoaderMinifyJSVerticalSpace;
+
                wfProfileIn( __METHOD__ );
 
                // For empty/whitespace-only data or for unknown filters, don't perform 
@@ -144,7 +146,9 @@ class ResourceLoader {
                try {
                        switch ( $filter ) {
                                case 'minify-js':
-                                       $result = JSMin::minify( $data );
+                                       $result = JavaScriptDistiller::stripWhiteSpace(
+                                               $data, $wgResourceLoaderMinifyJSVerticalSpace
+                                       );
                                        break;
                                case 'minify-css':
                                        $result = CSSMin::minify( $data );