<html><head><body><pre>Only in /Users/jlind/Sites/drupal_2012_03_23_11_46/sites/default/files/coder_upgrade/old/advagg: .git
diff -up -r advagg.admin.inc advagg.admin.inc
--- advagg.admin.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg.admin.inc	2012-03-23 13:02:15.000000000 -0600
@@ -36,27 +36,27 @@ function advagg_admin_info_form() {
   $form = array();
 
   $form[&#039;info&#039;] = array(
-    &#039;#type&#039;          =&gt; &#039;fieldset&#039;,
-    &#039;#collapsible&#039;   =&gt; TRUE,
-    &#039;#collapsed&#039;     =&gt; TRUE,
-    &#039;#title&#039;         =&gt; t(&#039;Hook Theme Info&#039;),
+    &#039;#type&#039; =&gt; &#039;fieldset&#039;,
+    &#039;#collapsible&#039; =&gt; TRUE,
+    &#039;#collapsed&#039; =&gt; TRUE,
+    &#039;#title&#039; =&gt; t(&#039;Hook Theme Info&#039;),
   );
   init_theme();
   $hooks = theme_get_registry();
   $data = implode(&quot;\n&quot;, $hooks[&#039;page&#039;][&#039;preprocess functions&#039;]);
   $form[&#039;info&#039;][&#039;advagg_debug_info&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;textarea&#039;,
-    &#039;#default_value&#039;  =&gt; $data,
-    &#039;#rows&#039;           =&gt; count($hooks[&#039;page&#039;][&#039;preprocess functions&#039;])+1,
+    &#039;#type&#039; =&gt; &#039;textarea&#039;,
+    &#039;#default_value&#039; =&gt; $data,
+    &#039;#rows&#039; =&gt; count($hooks[&#039;page&#039;][&#039;preprocess functions&#039;]) + 1,
   );
 
   $types = db_query(&quot;SELECT DISTINCT(filetype) FROM {advagg_files}&quot;);
   while ($type = db_result($types)) {
     $form[$type] = array(
-      &#039;#type&#039;          =&gt; &#039;fieldset&#039;,
-      &#039;#collapsible&#039;   =&gt; TRUE,
-      &#039;#collapsed&#039;     =&gt; TRUE,
-      &#039;#title&#039;         =&gt; t(&#039;@type files&#039;, array(&#039;@type&#039; =&gt; drupal_strtoupper($type))),
+      &#039;#type&#039; =&gt; &#039;fieldset&#039;,
+      &#039;#collapsible&#039; =&gt; TRUE,
+      &#039;#collapsed&#039; =&gt; TRUE,
+      &#039;#title&#039; =&gt; t(&#039;@type files&#039;, array(&#039;@type&#039; =&gt; drupal_strtoupper($type))),
     );
     // filename  filename_md5  checksum  filetype  counter   data
     $results = db_query(&quot;SELECT * FROM {advagg_files} WHERE filetype = &#039;%s&#039;&quot;, $type);
@@ -66,19 +66,19 @@ function advagg_admin_info_form() {
         list($data, $rows) = advagg_form_print_r($data);
 
         $form[$type][$row[&#039;filename_md5&#039;]] = array(
-          &#039;#type&#039;         =&gt; &#039;textarea&#039;,
-          &#039;#title&#039;        =&gt; check_plain($row[&#039;filename&#039;]),
-          &#039;#default_value&#039;  =&gt; $data,
-          &#039;#rows&#039;           =&gt; $rows-1,
-          &#039;#description&#039;  =&gt; t(&#039;File has changed %counter times&#039;, array(&#039;%counter&#039; =&gt; $row[&#039;counter&#039;])),
+          &#039;#type&#039; =&gt; &#039;textarea&#039;,
+          &#039;#title&#039; =&gt; check_plain($row[&#039;filename&#039;]),
+          &#039;#default_value&#039; =&gt; $data,
+          &#039;#rows&#039; =&gt; $rows -1,
+          &#039;#description&#039; =&gt; t(&#039;File has changed %counter times&#039;, array(&#039;%counter&#039; =&gt; $row[&#039;counter&#039;])),
         );
       }
       else {
         $form[$type][$row[&#039;filename_md5&#039;]] = array(
-          &#039;#type&#039;   =&gt; &#039;markup&#039;,
-          &#039;#value&#039;  =&gt; &#039;&lt;div&gt;&#039; . format_plural($row[&#039;counter&#039;], &#039;changed 1 time - %file&lt;br /&gt;&#039;, &#039;changed %counter times - %file&lt;br /&gt;&lt;/div&gt;&#039;,  array(
-            &#039;%counter&#039;  =&gt; $row[&#039;counter&#039;],
-            &#039;%file&#039;     =&gt; $row[&#039;filename&#039;],
+          &#039;#type&#039; =&gt; &#039;markup&#039;,
+          &#039;#value&#039; =&gt; &#039;&lt;div&gt;&#039; . format_plural($row[&#039;counter&#039;], &#039;changed 1 time - %file&lt;br /&gt;&#039;, &#039;changed %counter times - %file&lt;br /&gt;&lt;/div&gt;&#039;,   array(
+            &#039;%counter&#039; =&gt; $row[&#039;counter&#039;],
+            &#039;%file&#039; =&gt; $row[&#039;filename&#039;],
           )),
         );
       }
@@ -87,22 +87,20 @@ function advagg_admin_info_form() {
 
   // Get hooks in use.
   $hooks = array(
-    &#039;advagg_css_alter&#039;              =&gt; array(),
-    &#039;advagg_css_inline_alter&#039;       =&gt; array(),
-    &#039;advagg_css_pre_alter&#039;          =&gt; array(),
-    &#039;advagg_css_extra_alter&#039;        =&gt; array(),
-
-    &#039;advagg_js_alter&#039;               =&gt; array(),
-    &#039;advagg_js_inline_alter&#039;        =&gt; array(),
-    &#039;advagg_js_pre_alter&#039;           =&gt; array(),
-    &#039;advagg_js_extra_alter&#039;         =&gt; array(),
+    &#039;advagg_css_alter&#039; =&gt; array(),
+    &#039;advagg_css_inline_alter&#039; =&gt; array(),
+    &#039;advagg_css_pre_alter&#039; =&gt; array(),
+    &#039;advagg_css_extra_alter&#039; =&gt; array(),
+    &#039;advagg_js_alter&#039; =&gt; array(),
+    &#039;advagg_js_inline_alter&#039; =&gt; array(),
+    &#039;advagg_js_pre_alter&#039; =&gt; array(),
+    &#039;advagg_js_extra_alter&#039; =&gt; array(),
     &#039;advagg_js_header_footer_alter&#039; =&gt; array(),
-
-    &#039;advagg_filenames_alter&#039;        =&gt; array(),
-    &#039;advagg_files_table&#039;            =&gt; array(),
-    &#039;advagg_master_reset&#039;           =&gt; array(),
-    &#039;advagg_disable_processor&#039;      =&gt; array(),
-    &#039;advagg_disable_page_cache&#039;     =&gt; array(),
+    &#039;advagg_filenames_alter&#039; =&gt; array(),
+    &#039;advagg_files_table&#039; =&gt; array(),
+    &#039;advagg_master_reset&#039; =&gt; array(),
+    &#039;advagg_disable_processor&#039; =&gt; array(),
+    &#039;advagg_disable_page_cache&#039; =&gt; array(),
     &#039;advagg_bundler_analysis_alter&#039; =&gt; array(),
   );
   foreach ($hooks as $hook =&gt; $values) {
@@ -117,22 +115,22 @@ function advagg_admin_info_form() {
   foreach ($hooks as $hook =&gt; $values) {
     if (empty($values)) {
       $form[&#039;hooks_implemented&#039;][$hook] = array(
-      &#039;#type&#039;   =&gt; &#039;markup&#039;,
-      &#039;#value&#039;  =&gt; &#039;&lt;div&gt;&lt;strong&gt;&#039; . check_plain($hook) . &#039;:&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#039; . t(&#039;None&#039;) . &#039;&lt;/div&gt;&#039;,
+        &#039;#type&#039; =&gt; &#039;markup&#039;,
+        &#039;#value&#039; =&gt; &#039;&lt;div&gt;&lt;strong&gt;&#039; . check_plain($hook) . &#039;:&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#039; . t(&#039;None&#039;) . &#039;&lt;/div&gt;&#039;,
       );
     }
     else {
       $form[&#039;hooks_implemented&#039;][$hook] = array(
-        &#039;#type&#039;   =&gt; &#039;markup&#039;,
-        &#039;#value&#039;  =&gt; &#039;&lt;div&gt;&lt;strong&gt;&#039; . check_plain($hook) . &#039;:&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#039; . filter_xss(implode(&#039;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#039;, $values)) . &#039;&lt;/div&gt;&#039;,
+        &#039;#type&#039; =&gt; &#039;markup&#039;,
+        &#039;#value&#039; =&gt; &#039;&lt;div&gt;&lt;strong&gt;&#039; . check_plain($hook) . &#039;:&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#039; . filter_xss(implode(&#039;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#039;, $values)) . &#039;&lt;/div&gt;&#039;,
       );
     }
   }
   $form[&#039;hooks_implemented&#039;] += array(
-    &#039;#type&#039;          =&gt; &#039;fieldset&#039;,
-    &#039;#collapsible&#039;   =&gt; TRUE,
-    &#039;#collapsed&#039;     =&gt; TRUE,
-    &#039;#title&#039;         =&gt; t(&#039;Modules implementing advagg hooks&#039;),
+    &#039;#type&#039; =&gt; &#039;fieldset&#039;,
+    &#039;#collapsible&#039; =&gt; TRUE,
+    &#039;#collapsed&#039; =&gt; TRUE,
+    &#039;#title&#039; =&gt; t(&#039;Modules implementing advagg hooks&#039;),
   );
 
   // If any files are missing list them.
@@ -140,25 +138,25 @@ function advagg_admin_info_form() {
   $results = db_query(&quot;SELECT * FROM {advagg_files} WHERE checksum = &#039;-1&#039; ORDER BY filetype ASC&quot;);
   while ($row = db_fetch_array($results)) {
     $form[&#039;missing&#039;][$row[&#039;filename_md5&#039;]] = array(
-      &#039;#type&#039;   =&gt; &#039;markup&#039;,
-      &#039;#value&#039;  =&gt; &#039;&lt;div&gt;&#039; . check_plain($row[&#039;filename&#039;]) . &#039;&lt;br /&gt;&lt;/div&gt;&#039;,
+      &#039;#type&#039; =&gt; &#039;markup&#039;,
+      &#039;#value&#039; =&gt; &#039;&lt;div&gt;&#039; . check_plain($row[&#039;filename&#039;]) . &#039;&lt;br /&gt;&lt;/div&gt;&#039;,
     );
   }
   if (!empty($form[&#039;missing&#039;])) {
     $form[&#039;missing&#039;] += array(
-      &#039;#type&#039;          =&gt; &#039;fieldset&#039;,
-      &#039;#collapsible&#039;   =&gt; TRUE,
-      &#039;#collapsed&#039;     =&gt; FALSE,
-      &#039;#title&#039;         =&gt; t(&#039;Missing files&#039;),
+      &#039;#type&#039; =&gt; &#039;fieldset&#039;,
+      &#039;#collapsible&#039; =&gt; TRUE,
+      &#039;#collapsed&#039; =&gt; FALSE,
+      &#039;#title&#039; =&gt; t(&#039;Missing files&#039;),
     );
   }
 
   // Asynchronous raw output
   $form[&#039;async&#039;] = array(
-    &#039;#type&#039;          =&gt; &#039;fieldset&#039;,
-    &#039;#collapsible&#039;   =&gt; TRUE,
-    &#039;#collapsed&#039;     =&gt; TRUE,
-    &#039;#title&#039;         =&gt; t(&#039;Asynchronous debug info&#039;),
+    &#039;#type&#039; =&gt; &#039;fieldset&#039;,
+    &#039;#collapsible&#039; =&gt; TRUE,
+    &#039;#collapsed&#039; =&gt; TRUE,
+    &#039;#title&#039; =&gt; t(&#039;Asynchronous debug info&#039;),
   );
 
   list($css_path, $js_path) = advagg_get_root_files_dir();
@@ -175,10 +173,10 @@ function advagg_admin_info_form() {
   $data_local-&gt;timer = timer_stop(__FUNCTION__ . &#039;local&#039;);
   list($data, $rows) = advagg_form_print_r($data_local);
   $form[&#039;async&#039;][&#039;normal&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;textarea&#039;,
-    &#039;#title&#039;          =&gt; check_plain($url),
-    &#039;#default_value&#039;  =&gt; $data,
-    &#039;#rows&#039;           =&gt; min($rows+1, 50),
+    &#039;#type&#039; =&gt; &#039;textarea&#039;,
+    &#039;#title&#039; =&gt; check_plain($url),
+    &#039;#default_value&#039; =&gt; $data,
+    &#039;#rows&#039; =&gt; min($rows + 1, 50),
   );
 
   if (module_exists(&#039;cdn&#039;)) {
@@ -195,10 +193,10 @@ function advagg_admin_info_form() {
     $data_cdn-&gt;timer = timer_stop(__FUNCTION__ . &#039;cdn&#039;);
     list($data, $rows) = advagg_form_print_r($data_cdn);
     $form[&#039;async&#039;][&#039;cdn&#039;] = array(
-      &#039;#type&#039;           =&gt; &#039;textarea&#039;,
-      &#039;#title&#039;          =&gt; check_plain($url_cdn),
-      &#039;#default_value&#039;  =&gt; $data,
-      &#039;#rows&#039;           =&gt; min($rows+1, 50),
+      &#039;#type&#039; =&gt; &#039;textarea&#039;,
+      &#039;#title&#039; =&gt; check_plain($url_cdn),
+      &#039;#default_value&#039; =&gt; $data,
+      &#039;#rows&#039; =&gt; min($rows + 1, 50),
     );
   }
 
@@ -217,93 +215,93 @@ function advagg_admin_settings_form() {
   $bundle_count = db_result(db_query(&quot;SELECT COUNT(*) FROM (SELECT bundle_md5 FROM {advagg_bundles} GROUP BY bundle_md5) as temp&quot;));
 
   $form[&#039;advagg_enabled&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Enable Advanced Aggregation&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_enabled&#039;, ADVAGG_ENABLED),
+    &#039;#type&#039; =&gt; &#039;checkbox&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Enable Advanced Aggregation&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_enabled&#039;, ADVAGG_ENABLED),
   );
   $form[&#039;advagg_closure&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Use AdvAgg in closure&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_closure&#039;, ADVAGG_CLOSURE),
-    &#039;#description&#039;    =&gt; t(&#039;If enabled javascript files in the closure region will be aggregated.&#039;),
+    &#039;#type&#039; =&gt; &#039;checkbox&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Use AdvAgg in closure&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_closure&#039;, ADVAGG_CLOSURE),
+    &#039;#description&#039; =&gt; t(&#039;If enabled javascript files in the closure region will be aggregated.&#039;),
   );
   // Make sure the advagg_check_missing_handler function is available.
   module_load_install(&#039;advagg&#039;);
   $ret = advagg_check_missing_handler();
   $form[&#039;advagg_async_generation&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Generate CSS/JS files on request (async mode)&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_async_generation&#039;, ADVAGG_ASYNC_GENERATION),
-    &#039;#disabled&#039;       =&gt; $ret[&#039;advagg_async_generation&#039;][&#039;severity&#039;] == REQUIREMENT_ERROR ? TRUE : FALSE,
-    &#039;#description&#039;    =&gt; t(&#039;Current State: !value&#039;, array(
+    &#039;#type&#039; =&gt; &#039;checkbox&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Generate CSS/JS files on request (async mode)&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_async_generation&#039;, ADVAGG_ASYNC_GENERATION),
+    &#039;#disabled&#039; =&gt; $ret[&#039;advagg_async_generation&#039;][&#039;severity&#039;] == REQUIREMENT_ERROR ? TRUE : FALSE,
+    &#039;#description&#039; =&gt; t(&#039;Current State: !value&#039;, array(
       &#039;!value&#039; =&gt; filter_xss(&#039; &#039;
         . $ret[&#039;advagg_async_generation&#039;][&#039;value&#039;] . &#039; &#039;
         . (!empty($ret[&#039;advagg_async_generation&#039;][&#039;description&#039;]) ? $ret[&#039;advagg_async_generation&#039;][&#039;description&#039;] : &#039;&#039;) . &#039; &#039;
-      )
+      ),
     )),
   );
   $form[&#039;advagg_gzip_compression&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Gzip CSS/JS files&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_gzip_compression&#039;, ADVAGG_GZIP_COMPRESSION),
-    &#039;#description&#039;    =&gt; t(&#039;This might break CSS/JS handling at the Apache level. If it does, use the rules for your webroot level htaccess file before re-enabling. Directions on what to change are located in the &lt;a href=&quot;@readme&quot;&gt;readme&lt;/a&gt; file. In short, be sure to test this out.&#039;, array(&#039;@readme&#039; =&gt; url($readme))),
+    &#039;#type&#039; =&gt; &#039;checkbox&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Gzip CSS/JS files&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_gzip_compression&#039;, ADVAGG_GZIP_COMPRESSION),
+    &#039;#description&#039; =&gt; t(&#039;This might break CSS/JS handling at the Apache level. If it does, use the rules for your webroot level htaccess file before re-enabling. Directions on what to change are located in the &lt;a href=&quot;@readme&quot;&gt;readme&lt;/a&gt; file. In short, be sure to test this out.&#039;, array(&#039;@readme&#039; =&gt; url($readme))),
   );
   $form[&#039;advagg_dir_htaccess&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Generate .htaccess files in the advagg_* dirs&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_dir_htaccess&#039;, ADVAGG_DIR_HTACCESS),
-    &#039;#description&#039;    =&gt; t(&#039;Disable if your using the rules from the &lt;a href=&quot;@readme&quot;&gt;readme&lt;/a&gt; file in your webroot level htaccess file.&#039;, array(&#039;@readme&#039; =&gt; url($readme))),
+    &#039;#type&#039; =&gt; &#039;checkbox&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Generate .htaccess files in the advagg_* dirs&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_dir_htaccess&#039;, ADVAGG_DIR_HTACCESS),
+    &#039;#description&#039; =&gt; t(&#039;Disable if your using the rules from the &lt;a href=&quot;@readme&quot;&gt;readme&lt;/a&gt; file in your webroot level htaccess file.&#039;, array(&#039;@readme&#039; =&gt; url($readme))),
   );
   $form[&#039;advagg_rebuild_on_flush&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Regenerate flushed bundles in the cache flush request&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_rebuild_on_flush&#039;, ADVAGG_REBUILD_ON_FLUSH),
-    &#039;#description&#039;    =&gt; t(&#039;You can enable if your server will not timeout on a request. This will call advagg_rebuild_bundle() as a &lt;a href=&quot;http://php.net/register-shutdown-function&quot;&gt;shutdown function&lt;/a&gt; for every bundle that has been marked as expired; thus rebuilding that bundle in the same request as the flush.&#039;),
+    &#039;#type&#039; =&gt; &#039;checkbox&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Regenerate flushed bundles in the cache flush request&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_rebuild_on_flush&#039;, ADVAGG_REBUILD_ON_FLUSH),
+    &#039;#description&#039; =&gt; t(&#039;You can enable if your server will not timeout on a request. This will call advagg_rebuild_bundle() as a &lt;a href=&quot;http://php.net/register-shutdown-function&quot;&gt;shutdown function&lt;/a&gt; for every bundle that has been marked as expired; thus rebuilding that bundle in the same request as the flush.&#039;),
   );
   $public_downloads = (variable_get(&#039;file_downloads&#039;, FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);
   if (!$public_downloads) {
     $extra = module_exists(&#039;boost&#039;) ? t(&#039;If boost is installed, you can use the cache directory for advagg files.&#039;) : &#039;&#039;;
     $form[&#039;advagg_custom_files_dir&#039;] = array(
-      &#039;#type&#039;           =&gt; &#039;textfield&#039;,
-      &#039;#field_prefix&#039;   =&gt; &#039;&lt;div&gt;&#039; . t(&#039;You are using a private file system. You must serve aggregated files via a public folder.&#039;) . &#039;&lt;/div&gt;&#039;,
-      &#039;#title&#039;          =&gt; t(&#039;Use a different directory for storing advagg files&#039;),
-      &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_custom_files_dir&#039;, ADVAGG_CUSTOM_FILES_DIR),
-      &#039;#description&#039;    =&gt; check_plain(t(&#039;You need to create a publicly writable directory (same permissions as Drupals files folder).&#039;) . &#039; &#039; . $extra . &#039; &#039; . t(&#039;If you do not need this, you can put a space in this box.&#039;)),
-      &#039;#required&#039;       =&gt; TRUE,
+      &#039;#type&#039; =&gt; &#039;textfield&#039;,
+      &#039;#field_prefix&#039; =&gt; &#039;&lt;div&gt;&#039; . t(&#039;You are using a private file system. You must serve aggregated files via a public folder.&#039;) . &#039;&lt;/div&gt;&#039;,
+      &#039;#title&#039; =&gt; t(&#039;Use a different directory for storing advagg files&#039;),
+      &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_custom_files_dir&#039;, ADVAGG_CUSTOM_FILES_DIR),
+      &#039;#description&#039; =&gt; check_plain(t(&#039;You need to create a publicly writable directory (same permissions as Drupals files folder).&#039;) . &#039; &#039; . $extra . &#039; &#039; . t(&#039;If you do not need this, you can put a space in this box.&#039;)),
+      &#039;#required&#039; =&gt; TRUE,
     );
   }
   $options = array(
-      0 =&gt; t(&#039;Wait for locks&#039;),
-      1 =&gt; t(&#039;Do not wait for locks&#039;),
-      2 =&gt; t(&#039;Only serve aggregated files if they are already built (only works if async is enabled)&#039;),
+    0 =&gt; t(&#039;Wait for locks&#039;),
+    1 =&gt; t(&#039;Do not wait for locks&#039;),
+    2 =&gt; t(&#039;Only serve aggregated files if they are already built (only works if async is enabled)&#039;),
   );
   $form[&#039;advagg_aggregate_mode&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;radios&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Aggregation Inclusion Mode&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_aggregate_mode&#039;, ADVAGG_AGGREGATE_MODE),
-    &#039;#options&#039;        =&gt; $options,
-    &#039;#description&#039;    =&gt; t(&#039;Should the page wait for the aggregate to be built before including the file, or should it send out the page with aggregates not included.&#039;),
+    &#039;#type&#039; =&gt; &#039;radios&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Aggregation Inclusion Mode&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_aggregate_mode&#039;, ADVAGG_AGGREGATE_MODE),
+    &#039;#options&#039; =&gt; $options,
+    &#039;#description&#039; =&gt; t(&#039;Should the page wait for the aggregate to be built before including the file, or should it send out the page with aggregates not included.&#039;),
   );
   $form[&#039;advagg_page_cache_mode&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Disable page caching if all aggregates are not included on the page.&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_page_cache_mode&#039;, ADVAGG_PAGE_CACHE_MODE),
+    &#039;#type&#039; =&gt; &#039;checkbox&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Disable page caching if all aggregates are not included on the page.&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_page_cache_mode&#039;, ADVAGG_PAGE_CACHE_MODE),
   );
   $form[&#039;advagg_checksum_mode&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;radios&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;File Checksum Mode&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_checksum_mode&#039;, ADVAGG_CHECKSUM_MODE),
-    &#039;#options&#039;        =&gt; array(
+    &#039;#type&#039; =&gt; &#039;radios&#039;,
+    &#039;#title&#039; =&gt; t(&#039;File Checksum Mode&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_checksum_mode&#039;, ADVAGG_CHECKSUM_MODE),
+    &#039;#options&#039; =&gt; array(
       &#039;mtime&#039; =&gt; &#039;mtime&#039;,
       &#039;md5&#039; =&gt; &#039;md5&#039;,
     ),
-    &#039;#description&#039;    =&gt; t(&#039;If Drupal is on multiple servers and the file system is not shared;  using md5 is recommended. The file modification time (mtime) could be different with this type of setup. WARNING: Changing this value will invalidate all bundles and new ones will have to be built.&#039;),
+    &#039;#description&#039; =&gt; t(&#039;If Drupal is on multiple servers and the file system is not shared;  using md5 is recommended. The file modification time (mtime) could be different with this type of setup. WARNING: Changing this value will invalidate all bundles and new ones will have to be built.&#039;),
   );
   $form[&#039;advagg_server_addr&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;textfield&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;IP Address to send all asynchronous requests to&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_server_addr&#039;, FALSE),
-    &#039;#description&#039;    =&gt; t(&#039;If left blank it will use the same server as the request. If set to -1 it will use the host name instead of an IP address.&#039;),
+    &#039;#type&#039; =&gt; &#039;textfield&#039;,
+    &#039;#title&#039; =&gt; t(&#039;IP Address to send all asynchronous requests to&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_server_addr&#039;, FALSE),
+    &#039;#description&#039; =&gt; t(&#039;If left blank it will use the same server as the request. If set to -1 it will use the host name instead of an IP address.&#039;),
   );
 //   $form[&#039;advagg_debug&#039;] = array(
 //     &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
@@ -312,74 +310,74 @@ function advagg_admin_settings_form() {
 //   );
 
   $form[&#039;flush&#039;] = array(
-    &#039;#type&#039;         =&gt; &#039;fieldset&#039;,
-    &#039;#title&#039;        =&gt; t(&#039;Smart cache flush&#039;),
-    &#039;#description&#039;  =&gt; t(&#039;Scan all files referenced in aggregated files. If any of them have changed, increment the counters containing that file and rebuild the bundle.&#039;),
+    &#039;#type&#039; =&gt; &#039;fieldset&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Smart cache flush&#039;),
+    &#039;#description&#039; =&gt; t(&#039;Scan all files referenced in aggregated files. If any of them have changed, increment the counters containing that file and rebuild the bundle.&#039;),
   );
   $form[&#039;flush&#039;][&#039;advagg_flush&#039;] = array(
-    &#039;#type&#039;   =&gt; &#039;submit&#039;,
-    &#039;#value&#039;  =&gt; t(&#039;Flush AdvAgg Cache&#039;),
+    &#039;#type&#039; =&gt; &#039;submit&#039;,
+    &#039;#value&#039; =&gt; t(&#039;Flush AdvAgg Cache&#039;),
     &#039;#submit&#039; =&gt; array(&#039;advagg_admin_flush_cache_button&#039;),
   );
   $form[&#039;rebuild&#039;] = array(
-    &#039;#type&#039;         =&gt; &#039;fieldset&#039;,
-    &#039;#collapsible&#039;  =&gt; TRUE,
-    &#039;#collapsed&#039;    =&gt; TRUE,
-    &#039;#title&#039;        =&gt; t(&#039;Cache Rebuild&#039;),
-    &#039;#description&#039;  =&gt; t(&#039;Recreate all aggregated files. Useful if JS or CSS compression was just enabled. %count Files&#039;, array(&#039;%count&#039; =&gt; $bundle_count)),
+    &#039;#type&#039; =&gt; &#039;fieldset&#039;,
+    &#039;#collapsible&#039; =&gt; TRUE,
+    &#039;#collapsed&#039; =&gt; TRUE,
+    &#039;#title&#039; =&gt; t(&#039;Cache Rebuild&#039;),
+    &#039;#description&#039; =&gt; t(&#039;Recreate all aggregated files. Useful if JS or CSS compression was just enabled. %count Files&#039;, array(&#039;%count&#039; =&gt; $bundle_count)),
   );
   $form[&#039;rebuild&#039;][&#039;advagg_rebuild&#039;] = array(
-    &#039;#type&#039;   =&gt; &#039;submit&#039;,
-    &#039;#value&#039;  =&gt; t(&#039;Rebuild AdvAgg Cache&#039;),
+    &#039;#type&#039; =&gt; &#039;submit&#039;,
+    &#039;#value&#039; =&gt; t(&#039;Rebuild AdvAgg Cache&#039;),
     &#039;#submit&#039; =&gt; array(&#039;advagg_admin_batch_rebuild&#039;),
   );
   $form[&#039;forced_rebuild&#039;] = array(
-    &#039;#type&#039;         =&gt; &#039;fieldset&#039;,
-    &#039;#collapsible&#039;  =&gt; TRUE,
-    &#039;#collapsed&#039;    =&gt; TRUE,
-    &#039;#title&#039;        =&gt; t(&#039;Forced Cache Rebuild&#039;),
-    &#039;#description&#039;  =&gt; t(&#039;Recreate all aggregated files by incrementing internal counter for every bundle. %count Files&#039;, array(&#039;%count&#039; =&gt; $bundle_count)),
+    &#039;#type&#039; =&gt; &#039;fieldset&#039;,
+    &#039;#collapsible&#039; =&gt; TRUE,
+    &#039;#collapsed&#039; =&gt; TRUE,
+    &#039;#title&#039; =&gt; t(&#039;Forced Cache Rebuild&#039;),
+    &#039;#description&#039; =&gt; t(&#039;Recreate all aggregated files by incrementing internal counter for every bundle. %count Files&#039;, array(&#039;%count&#039; =&gt; $bundle_count)),
   );
   $form[&#039;forced_rebuild&#039;][&#039;advagg_forced_build&#039;] = array(
-    &#039;#type&#039;   =&gt; &#039;submit&#039;,
-    &#039;#value&#039;  =&gt; t(&#039;Force all counters to be increment by one&#039;),
+    &#039;#type&#039; =&gt; &#039;submit&#039;,
+    &#039;#value&#039; =&gt; t(&#039;Force all counters to be increment by one&#039;),
     &#039;#submit&#039; =&gt; array(&#039;advagg_admin_batch_rebuild&#039;),
   );
   $form[&#039;master_reset&#039;] = array(
-    &#039;#type&#039;         =&gt; &#039;fieldset&#039;,
-    &#039;#collapsible&#039;  =&gt; TRUE,
-    &#039;#collapsed&#039;    =&gt; TRUE,
-    &#039;#title&#039;        =&gt; t(&#039;Master Reset&#039;),
-    &#039;#description&#039;  =&gt; t(&#039;Clean Slate - Truncate all advagg tables and delete all advagg files. Useful for testing purposes. Running this on a production site is not a good idea.&#039;),
+    &#039;#type&#039; =&gt; &#039;fieldset&#039;,
+    &#039;#collapsible&#039; =&gt; TRUE,
+    &#039;#collapsed&#039; =&gt; TRUE,
+    &#039;#title&#039; =&gt; t(&#039;Master Reset&#039;),
+    &#039;#description&#039; =&gt; t(&#039;Clean Slate - Truncate all advagg tables and delete all advagg files. Useful for testing purposes. Running this on a production site is not a good idea.&#039;),
   );
   $form[&#039;master_reset&#039;][&#039;advagg_reset&#039;] = array(
-    &#039;#type&#039;         =&gt; &#039;submit&#039;,
-    &#039;#value&#039;        =&gt; t(&#039;Master Reset&#039;),
-    &#039;#submit&#039;       =&gt; array(&#039;advagg_admin_master_reset&#039;),
+    &#039;#type&#039; =&gt; &#039;submit&#039;,
+    &#039;#value&#039; =&gt; t(&#039;Master Reset&#039;),
+    &#039;#submit&#039; =&gt; array(&#039;advagg_admin_master_reset&#039;),
   );
   $form[&#039;htaccess&#039;] = array(
-    &#039;#type&#039;         =&gt; &#039;fieldset&#039;,
-    &#039;#collapsible&#039;  =&gt; TRUE,
-    &#039;#collapsed&#039;    =&gt; TRUE,
-    &#039;#title&#039;        =&gt; t(&#039;Rebuild htaccess files&#039;),
-    &#039;#description&#039;  =&gt; t(&#039;This will recreate the htaccess files located in the advagg_* directories.&#039;),
+    &#039;#type&#039; =&gt; &#039;fieldset&#039;,
+    &#039;#collapsible&#039; =&gt; TRUE,
+    &#039;#collapsed&#039; =&gt; TRUE,
+    &#039;#title&#039; =&gt; t(&#039;Rebuild htaccess files&#039;),
+    &#039;#description&#039; =&gt; t(&#039;This will recreate the htaccess files located in the advagg_* directories.&#039;),
   );
   $form[&#039;htaccess&#039;][&#039;advagg_recreate_htaccess&#039;] = array(
-    &#039;#type&#039;   =&gt; &#039;submit&#039;,
-    &#039;#value&#039;  =&gt; t(&#039;Recreate htaccess files&#039;),
+    &#039;#type&#039; =&gt; &#039;submit&#039;,
+    &#039;#value&#039; =&gt; t(&#039;Recreate htaccess files&#039;),
     &#039;#submit&#039; =&gt; array(&#039;advagg_admin_recreate_htaccess&#039;),
   );
   $form[&#039;bypass&#039;] = array(
-    &#039;#type&#039;         =&gt; &#039;fieldset&#039;,
-    &#039;#title&#039;        =&gt; t(&#039;Aggregation Bypass Cookie&#039;),
-    &#039;#description&#039;  =&gt; t(&#039;This will set or remove a cookie that disables aggregation for the remainder of the browser session.&#039;),
+    &#039;#type&#039; =&gt; &#039;fieldset&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Aggregation Bypass Cookie&#039;),
+    &#039;#description&#039; =&gt; t(&#039;This will set or remove a cookie that disables aggregation for the remainder of the browser session.&#039;),
   );
   $form[&#039;bypass&#039;][&#039;submit&#039;] = array(
-    &#039;#type&#039;         =&gt; &#039;submit&#039;,
+    &#039;#type&#039; =&gt; &#039;submit&#039;,
     #&#039;#button_type&#039;  =&gt; &#039;button&#039;,
-    &#039;#value&#039;        =&gt; t(&#039;Toggle the &quot;aggregation bypass cookie&quot; for this browser&#039;),
-    &#039;#attributes&#039;   =&gt; array(&#039;onclick&#039; =&gt; &#039;javascript:return advagg_toggle_cookie()&#039;),
-    &#039;#submit&#039;       =&gt; array(&#039;advagg_admin_toggle_bypass_cookie&#039;),
+    &#039;#value&#039; =&gt; t(&#039;Toggle the &quot;aggregation bypass cookie&quot; for this browser&#039;),
+    &#039;#attributes&#039; =&gt; array(&#039;onclick&#039; =&gt; &#039;javascript:return advagg_toggle_cookie()&#039;),
+    &#039;#submit&#039; =&gt; array(&#039;advagg_admin_toggle_bypass_cookie&#039;),
   );
 
   $form[&#039;#submit&#039;][] = &#039;advagg_admin_settings_form_submit&#039;;
@@ -635,7 +633,7 @@ function advagg_admin_rebuild_bundles($i
 function advagg_admin_rebuild_bundles_done($success, $results, $operations) {
   if ($success) {
     // Here we do something meaningful with the results.
-    $message = count($results) .&#039; files generated.&#039;;
+    $message = count($results) . &#039; files generated.&#039;;
     $message .= theme(&#039;item_list&#039;, $results);
   }
   else {
diff -up -r advagg.install advagg.install
--- advagg.install	2012-03-23 12:08:13.000000000 -0600
+++ advagg.install	2012-03-23 13:02:15.000000000 -0600
@@ -117,57 +117,57 @@ function advagg_requirements($phase) {
     list($css_path, $js_path) = advagg_get_root_files_dir();
     if (!file_check_directory($css_path, FILE_CREATE_DIRECTORY)) {
       $requirements[&#039;advagg_css_path&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - CSS Path&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_ERROR,
-        &#039;value&#039;       =&gt; $t(&#039;CSS directory is not created or writable&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - CSS Path&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_ERROR,
+        &#039;value&#039; =&gt; $t(&#039;CSS directory is not created or writable&#039;),
         &#039;description&#039; =&gt; $t(&#039;%path is not setup correctly.&#039;, array(&#039;%path&#039; =&gt; $css_path)),
       );
     }
     if (!file_check_directory($js_path, FILE_CREATE_DIRECTORY)) {
       $requirements[&#039;advagg_js_path&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - JS Path&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_ERROR,
-        &#039;value&#039;       =&gt; $t(&#039;JS directory is not created or writable&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - JS Path&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_ERROR,
+        &#039;value&#039; =&gt; $t(&#039;JS directory is not created or writable&#039;),
         &#039;description&#039; =&gt; $t(&#039;%path is not setup correctly.&#039;, array(&#039;%path&#039; =&gt; $js_path)),
       );
     }
     if (variable_get(&#039;preprocess_css&#039;, FALSE) || variable_get(&#039;preprocess_js&#039;, FALSE)) {
       $requirements[&#039;advagg_core_off&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Core Variables&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_ERROR,
-        &#039;value&#039;       =&gt; $t(&#039;Cores CSS and/or JS aggregation is enabled&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Core Variables&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_ERROR,
+        &#039;value&#039; =&gt; $t(&#039;Cores CSS and/or JS aggregation is enabled&#039;),
         &#039;description&#039; =&gt; $t(&#039;&quot;Optimize CSS files&quot; and &quot;Optimize JavaScript files&quot; on the &lt;a href=&quot;@performance&quot;&gt;performance page&lt;/a&gt; should be disabled.&#039;, array(&#039;@performance&#039; =&gt; url(&#039;admin/settings/performance&#039;))),
       );
     }
     if (variable_get(&#039;advagg_enabled&#039;, ADVAGG_ENABLED) == FALSE) {
       $requirements[&#039;advagg_not_on&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Enabled&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-        &#039;value&#039;       =&gt; $t(&#039;Advanced CSS/JS aggregation is not currently enabled.&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Enabled&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+        &#039;value&#039; =&gt; $t(&#039;Advanced CSS/JS aggregation is not currently enabled.&#039;),
         &#039;description&#039; =&gt; $t(&#039;Go to the Advanced CSS/JS aggregation &lt;a href=&quot;@settings&quot;&gt;settings page&lt;/a&gt; and enable it.&#039;, array(&#039;@settings&#039; =&gt; url(&#039;admin/settings/advagg&#039;))),
       );
     }
     if (module_exists(&#039;css_gzip&#039;)) {
       $requirements[&#039;advagg_css_gzip&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - CSS Gzip&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-        &#039;value&#039;       =&gt; $t(&#039;The CSS Gzip module is enabled&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - CSS Gzip&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+        &#039;value&#039; =&gt; $t(&#039;The CSS Gzip module is enabled&#039;),
         &#039;description&#039; =&gt; $t(&#039;On the &lt;a href=&quot;@modules&quot;&gt;modules page&lt;/a&gt; you can disable it, as this module is no longer needed.&#039;, array(&#039;@modules&#039; =&gt; url(&#039;admin/build/modules&#039;))),
       );
     }
     if (module_exists(&#039;csstidy&#039;)) {
       $requirements[&#039;advagg_csstidy&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - CSS Tidy&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-        &#039;value&#039;       =&gt; $t(&#039;The CSS Tidy module is enabled&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - CSS Tidy&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+        &#039;value&#039; =&gt; $t(&#039;The CSS Tidy module is enabled&#039;),
         &#039;description&#039; =&gt; $t(&#039;On the &lt;a href=&quot;@modules&quot;&gt;modules page&lt;/a&gt; you can disable it, as this module is no longer needed.&#039;, array(&#039;@modules&#039; =&gt; url(&#039;admin/build/modules&#039;))),
       );
     }
     if (module_exists(&#039;javascript_aggregator&#039;)) {
       $requirements[&#039;advagg_javascript_aggregator&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Javascript Aggregator&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-        &#039;value&#039;       =&gt; $t(&#039;The Javascript Aggregator is enabled&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Javascript Aggregator&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+        &#039;value&#039; =&gt; $t(&#039;The Javascript Aggregator is enabled&#039;),
         &#039;description&#039; =&gt; $t(&#039;On the &lt;a href=&quot;@modules&quot;&gt;modules page&lt;/a&gt; you can disable it, as this module is no longer needed. Once uninstalled be sure to enable the &quot;Use AdvAgg in closure&quot; setting on the &lt;a href=&quot;@config&quot;&gt;advagg config page&lt;/a&gt;&#039;, array(
           &#039;@modules&#039; =&gt; url(&#039;admin/build/modules&#039;),
           &#039;@config&#039; =&gt; url(&#039;admin/settings/advagg/config&#039;),
@@ -176,49 +176,49 @@ function advagg_requirements($phase) {
     }
     if (module_exists(&#039;unlimited_css&#039;)) {
       $requirements[&#039;advagg_unlimited_css&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - IE Unlimited CSS Loader&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-        &#039;value&#039;       =&gt; $t(&#039;The IE Unlimited CSS Loader module is enabled&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - IE Unlimited CSS Loader&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+        &#039;value&#039; =&gt; $t(&#039;The IE Unlimited CSS Loader module is enabled&#039;),
         &#039;description&#039; =&gt; $t(&#039;On the &lt;a href=&quot;@modules&quot;&gt;modules page&lt;/a&gt; you can disable it, as this module is no longer needed.&#039;, array(&#039;@modules&#039; =&gt; url(&#039;admin/build/modules&#039;))),
       );
     }
     if (module_exists(&#039;ie_css_optimizer&#039;)) {
       $requirements[&#039;advagg_unlimited_css&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - IE CSS Optimizer&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-        &#039;value&#039;       =&gt; $t(&#039;The IE CSS Optimizer module is enabled&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - IE CSS Optimizer&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+        &#039;value&#039; =&gt; $t(&#039;The IE CSS Optimizer module is enabled&#039;),
         &#039;description&#039; =&gt; $t(&#039;On the &lt;a href=&quot;@modules&quot;&gt;modules page&lt;/a&gt; you can disable it, as this module is no longer needed.&#039;, array(&#039;@modules&#039; =&gt; url(&#039;admin/build/modules&#039;))),
       );
     }
     if (module_exists(&#039;cmscdn&#039;)) {
       $requirements[&#039;advagg_cmscdn&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - CMS CDN&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-        &#039;value&#039;       =&gt; $t(&#039;The CMS CDN module is enabled.&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - CMS CDN&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+        &#039;value&#039; =&gt; $t(&#039;The CMS CDN module is enabled.&#039;),
         &#039;description&#039; =&gt; $t(&#039;On the &lt;a href=&quot;@modules&quot;&gt;modules page&lt;/a&gt; you can disable it, as this module is no longer needed.&#039;, array(&#039;@modules&#039; =&gt; url(&#039;admin/build/modules&#039;))),
       );
     }
     if (module_exists(&#039;bundlecache&#039;)) {
       $requirements[&#039;advagg_bundlecache&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - BundleCache&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-        &#039;value&#039;       =&gt; $t(&#039;The BundleCache module is enabled.&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - BundleCache&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+        &#039;value&#039; =&gt; $t(&#039;The BundleCache module is enabled.&#039;),
         &#039;description&#039; =&gt; $t(&#039;On the &lt;a href=&quot;@modules&quot;&gt;modules page&lt;/a&gt; you can disable it, as this module is no longer needed.&#039;, array(&#039;@modules&#039; =&gt; url(&#039;admin/build/modules&#039;))),
       );
     }
     if (module_exists(&#039;css_emimage&#039;) &amp;&amp; !function_exists(&#039;css_emimage_advagg_filenames_alter&#039;)) {
       $requirements[&#039;advagg_css_emimage&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - CSS Embedded Images&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-        &#039;value&#039;       =&gt; $t(&#039;CSS Embedded Images module needs a patch.&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - CSS Embedded Images&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+        &#039;value&#039; =&gt; $t(&#039;CSS Embedded Images module needs a patch.&#039;),
         &#039;description&#039; =&gt; $t(&#039;You need to apply the latest patch from this issue &lt;a href=&quot;@issue&quot;&gt;CSS Embedded Images - Add in support for advaggs hooks&lt;/a&gt;; otherwise these 2 modules are not compatible with each other.&#039;, array(&#039;@issue&#039; =&gt; &#039;http://drupal.org/node/1078060&#039;)),
       );
     }
     if (isset($_advagg[&#039;closure&#039;]) &amp;&amp; $_advagg[&#039;closure&#039;] == FALSE) {
       $requirements[&#039;advagg_closure&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Closure&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-        &#039;value&#039;       =&gt; $t(&#039;Your theme implements its own closure function.&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Closure&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+        &#039;value&#039; =&gt; $t(&#039;Your theme implements its own closure function.&#039;),
         &#039;description&#039; =&gt; $t(&#039;To solve this problem, you unfortunately have to modify your theme. Copy the phptemplate_closure() function found in &lt;a href=&quot;@link&quot;&gt;advagg.module source code&lt;/a&gt; and integrate it into your theme phptemplate_closure() function or &lt;themename&gt;_closure() function.&#039;, array(&#039;@link&#039; =&gt; &#039;http://drupalcode.org/project/advagg.git/blob/refs/heads/6.x-1.x:/advagg.module#l201&#039;)),
       );
     }
@@ -229,9 +229,9 @@ function advagg_requirements($phase) {
       $file_path_blacklist = array_filter($file_path_blacklist);
       if (array_search(&#039;*.js&#039;, $file_path_blacklist) !== FALSE) {
         $requirements[&#039;advagg_cdn_js_blacklist&#039;] = array(
-          &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - CDN Settings&#039;),
-          &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-          &#039;value&#039;       =&gt; $t(&#039;The CDN module is set to blacklist all *.js files.&#039;),
+          &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - CDN Settings&#039;),
+          &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+          &#039;value&#039; =&gt; $t(&#039;The CDN module is set to blacklist all *.js files.&#039;),
           &#039;description&#039; =&gt; $t(&#039;Check your &lt;a href=&quot;@cdn&quot;&gt;CDN settings&lt;/a&gt; and adjust the blacklist to not include &quot;*.js&quot;. Testing is important in this case. &quot;*tiny_mce.js&quot; is a file/pattern we had to add to the blacklist after removing *.js from it.&#039;, array(&#039;@cdn&#039; =&gt; url(&#039;admin/settings/cdn/other&#039;))),
         );
       }
@@ -241,12 +241,12 @@ function advagg_requirements($phase) {
     $function = advagg_install_theme_registry_location($hooks);
     if ($function != &#039;advagg_processor&#039;) {
       $requirements[&#039;advagg_theme&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Theme Hook&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_ERROR,
-        &#039;value&#039;       =&gt; $t(&#039;Theme hook is not in the correct place.&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Theme Hook&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_ERROR,
+        &#039;value&#039; =&gt; $t(&#039;Theme hook is not in the correct place.&#039;),
         &#039;description&#039; =&gt; $t(&#039;On the &lt;a href=&quot;@performance&quot;&gt;performance page&lt;/a&gt; clear the cache. If this is still an issue open up a bug on the &lt;a href=&quot;http://drupal.org/node/add/project-issue/advagg&quot;&gt;advagg issue queue&lt;/a&gt; and be sure to include the &quot;Hook Theme Info&quot; output from the Advanced CSS/JS aggregation &lt;a href=&quot;@settings&quot;&gt;settings page&lt;/a&gt;.&#039;, array(
-          &#039;@performance&#039;  =&gt; url(&#039;admin/settings/performance&#039;),
-          &#039;@settings&#039;     =&gt; url(&#039;admin/settings/advagg&#039;),
+          &#039;@performance&#039; =&gt; url(&#039;admin/settings/performance&#039;),
+          &#039;@settings&#039; =&gt; url(&#039;admin/settings/advagg&#039;),
         )),
       );
     }
@@ -254,11 +254,11 @@ function advagg_requirements($phase) {
     $function = $hooks[&#039;closure&#039;][&#039;function&#039;];
     if ($function != &#039;phptemplate_closure&#039; &amp;&amp; variable_get(&#039;advagg_closure&#039;, ADVAGG_CLOSURE)) {
       $requirements[&#039;advagg_closure&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Closure&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_ERROR,
-        &#039;value&#039;       =&gt; $t(&#039;Closure theme function issue.&#039;) . $function,
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Closure&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_ERROR,
+        &#039;value&#039; =&gt; $t(&#039;Closure theme function issue.&#039;) . $function,
         &#039;description&#039; =&gt; $t(&#039;On the &lt;a href=&quot;@performance&quot;&gt;performance page&lt;/a&gt; clear the cache or just the theme registry if you know how to do that. If this is still an issue open up a bug on the &lt;a href=&quot;http://drupal.org/node/add/project-issue/advagg&quot;&gt;advagg issue queue&lt;/a&gt;.&#039;, array(
-          &#039;@performance&#039;  =&gt; url(&#039;admin/settings/performance&#039;),
+          &#039;@performance&#039; =&gt; url(&#039;admin/settings/performance&#039;),
         )),
       );
     }
@@ -313,9 +313,9 @@ function advagg_check_missing_handler() 
   // Don&#039;t run the test if site is offline
   if (variable_get(&#039;site_offline&#039;, 0)) {
     $ret[&#039;advagg_async_offline&#039;] = array(
-      &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Asynchronous Mode&#039;),
-      &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-      &#039;value&#039;       =&gt; $t(&#039;Unknown. Currently set to @value.&#039;, array(&#039;@value&#039; =&gt; $async ? &#039;TRUE&#039; : &#039;FALSE&#039;)),
+      &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Asynchronous Mode&#039;),
+      &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+      &#039;value&#039; =&gt; $t(&#039;Unknown. Currently set to @value.&#039;, array(&#039;@value&#039; =&gt; $async ? &#039;TRUE&#039; : &#039;FALSE&#039;)),
       &#039;description&#039; =&gt; $t(&#039;This can not be tested while the site is in &lt;a href=&quot;@maintenance&quot;&gt;offline mode&lt;/a&gt;&#039;, array(&#039;@maintenance&#039; =&gt; url(&#039;admin/settings/site-maintenance&#039;))),
     );
     return $ret;
@@ -335,9 +335,9 @@ function advagg_check_missing_handler() 
   if (empty($item[&#039;page_callback&#039;]) || strpos($item[&#039;page_callback&#039;], &#039;advagg&#039;) === FALSE) {
     $item = str_replace(&#039;    &#039;, &#039;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#039;, nl2br(htmlentities(print_r($item, TRUE))));
     $ret[&#039;advagg_async_generation_menu_issue&#039;] = array(
-      &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Async Mode&#039;),
-      &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-      &#039;value&#039;       =&gt; $t(&#039;Flush your caches&#039;),
+      &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Async Mode&#039;),
+      &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+      &#039;value&#039; =&gt; $t(&#039;Flush your caches&#039;),
       &#039;description&#039; =&gt; $t(&#039;You need to flush your menu cache. This can be done near the bottom of the &lt;a href=&quot;@performance&quot;&gt;performance page&lt;/a&gt;. If this does not fix the issue copy this info below when opening up an &lt;a href=&quot;http://drupal.org/node/add/project-issue/advagg&quot;&gt;issue for advagg&lt;/a&gt;: &lt;br /&gt; !info&#039;, array(
         &#039;@performance&#039; =&gt; url(&#039;admin/settings/performance&#039;),
         &#039;!info&#039; =&gt; $item,
@@ -349,9 +349,9 @@ function advagg_check_missing_handler() 
   if (empty($item[&#039;page_callback&#039;]) || strpos($item[&#039;page_callback&#039;], &#039;advagg&#039;) === FALSE) {
     $item = str_replace(&#039;    &#039;, &#039;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&#039;, nl2br(htmlentities(print_r($item, TRUE))));
     $ret[&#039;advagg_async_generation_menu_issue&#039;] = array(
-      &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Async Mode&#039;),
-      &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-      &#039;value&#039;       =&gt; $t(&#039;Flush your caches&#039;),
+      &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Async Mode&#039;),
+      &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+      &#039;value&#039; =&gt; $t(&#039;Flush your caches&#039;),
       &#039;description&#039; =&gt; $t(&#039;You need to flush your menu cache. This can be done near the bottom of the &lt;a href=&quot;@performance&quot;&gt;performance page&lt;/a&gt;. If this does not fix the issue copy this info below when opening up an &lt;a href=&quot;http://drupal.org/node/add/project-issue/advagg&quot;&gt;issue for advagg&lt;/a&gt;: &lt;br /&gt; !info&#039;, array(
         &#039;@performance&#039; =&gt; url(&#039;admin/settings/performance&#039;),
         &#039;!info&#039; =&gt; $item,
@@ -418,9 +418,9 @@ function advagg_check_missing_handler() 
 
   $extra_404 = $t(&#039;If you are still having issues you can go to the &lt;a href=&quot;@info&quot;&gt;AdvAgg information tab&lt;/a&gt; and select Asynchronous debug info. If creating an issue on d.o be sure to include this information @cdn_extra.&#039;,
     array(
-      &#039;@info&#039; =&gt; url(&#039;admin/settings/advagg/info&#039;),
-      &#039;@cdn_extra&#039; =&gt; $cdn_extra,
-    )
+    &#039;@info&#039; =&gt; url(&#039;admin/settings/advagg/info&#039;),
+    &#039;@cdn_extra&#039; =&gt; $cdn_extra,
+  )
   );
   $extra_404 .= module_exists(&#039;stage_file_proxy&#039;) ? $t(&#039;&lt;a href=&quot;http://drupal.org/project/stage_file_proxy&quot;&gt;Stage File Proxy&lt;/a&gt; needs &lt;a href=&quot;http://drupal.org/node/1078218&quot;&gt;this patch&lt;/a&gt; applied to it in order for advagg to work correctly.&#039;) : &#039;&#039;;
 
@@ -428,35 +428,35 @@ function advagg_check_missing_handler() 
   $cdn_failed = FALSE;
   if (isset($parts_css) &amp;&amp; empty($parts_css)) {
     $ret[&#039;advagg_async_generation_css_cdn&#039;] = array(
-      &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - CDN Async Mode&#039;),
-      &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-      &#039;value&#039;       =&gt; $t(&#039;CSS CDN Issue&#039;),
+      &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - CDN Async Mode&#039;),
+      &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+      &#039;value&#039; =&gt; $t(&#039;CSS CDN Issue&#039;),
       &#039;description&#039; =&gt; $t(&#039;Your current CDN settings are not rewriting the URL for advagg CSS files to point to your CDN. Most likely you need to adjust your &lt;a href=&quot;@cdnother&quot;&gt;CDN exceptions&lt;/a&gt; to allow CSS files from advagg.&#039;, array(&#039;@cdnother&#039; =&gt; url(&#039;admin/settings/cdn/other&#039;))),
     );
   }
   if (isset($parts_js) &amp;&amp; empty($parts_js)) {
     $ret[&#039;advagg_async_generation_js_cdn&#039;] = array(
-      &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - CDN Async Mode&#039;),
-      &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-      &#039;value&#039;       =&gt; $t(&#039;JS CDN Issue&#039;),
+      &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - CDN Async Mode&#039;),
+      &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+      &#039;value&#039; =&gt; $t(&#039;JS CDN Issue&#039;),
       &#039;description&#039; =&gt; $t(&#039;Your current CDN settings are not rewriting the URL for advagg JS files to point to your CDN. Most likely you need to adjust your &lt;a href=&quot;@cdnother&quot;&gt;CDN exceptions&lt;/a&gt; to allow JS files from advagg.&#039;, array(&#039;@cdnother&#039; =&gt; url(&#039;admin/settings/cdn/other&#039;))),
     );
   }
   if (isset($data_cdn_css)) {
     if ($data_cdn_css-&gt;code != 200 &amp;&amp; $mode == CDN_MODE_BASIC &amp;&amp; (!empty($data_cdn_css-&gt;headers[&#039;X-AdvAgg&#039;]) || (!empty($data_cdn_css-&gt;data) &amp;&amp; strpos($data_cdn_css-&gt;data, &#039;&lt;!-- advagg_missing_fast404 --&gt;&#039;) !== FALSE))) {
       $ret[&#039;advagg_async_generation_css_cdn&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - CDN Async Mode&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_OK,
-        &#039;value&#039;       =&gt; $t(&#039;CSS CDN&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - CDN Async Mode&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_OK,
+        &#039;value&#039; =&gt; $t(&#039;CSS CDN&#039;),
         &#039;description&#039; =&gt; $t(&#039;Requests through the CDN are getting back to advagg for CSS files.&#039;),
       );
     }
     else {
       $cdn_failed = TRUE;
       $ret[&#039;advagg_async_generation_css_cdn&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - CDN Async Mode&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-        &#039;value&#039;       =&gt; $t(&#039;CSS CDN Issue&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - CDN Async Mode&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+        &#039;value&#039; =&gt; $t(&#039;CSS CDN Issue&#039;),
         &#039;description&#039; =&gt; $t(&#039;Check your &lt;a href=&quot;@cdn&quot;&gt;CDN settings&lt;/a&gt;; CSS request is not coming back when routed through the CDN. &#039;, array(&#039;@cdn&#039; =&gt; url(&#039;admin/settings/cdn&#039;))) . $extra_404,
       );
     }
@@ -464,18 +464,18 @@ function advagg_check_missing_handler() 
   if (isset($data_cdn_js)) {
     if ($data_cdn_js-&gt;code != 200 &amp;&amp; $mode == CDN_MODE_BASIC &amp;&amp; (!empty($data_cdn_js-&gt;headers[&#039;X-AdvAgg&#039;]) || (!empty($data_cdn_js-&gt;data) &amp;&amp; strpos($data_cdn_js-&gt;data, &#039;&lt;!-- advagg_missing_fast404 --&gt;&#039;) !== FALSE))) {
       $ret[&#039;advagg_async_generation_js_cdn&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - CDN Async Mode&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_OK,
-        &#039;value&#039;       =&gt; $t(&#039;JS CDN&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - CDN Async Mode&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_OK,
+        &#039;value&#039; =&gt; $t(&#039;JS CDN&#039;),
         &#039;description&#039; =&gt; $t(&#039;Requests through the CDN are getting back to advagg for JS files.&#039;),
       );
     }
     else {
       $cdn_failed = TRUE;
       $ret[&#039;advagg_async_generation_js_cdn&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - CDN Async Mode&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-        &#039;value&#039;       =&gt; $t(&#039;JS CDN Issue&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - CDN Async Mode&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+        &#039;value&#039; =&gt; $t(&#039;JS CDN Issue&#039;),
         &#039;description&#039; =&gt; $t(&#039;Check your &lt;a href=&quot;@cdn&quot;&gt;CDN settings&lt;/a&gt;; JS request is not coming back when routed through the CDN. &#039;, array(&#039;@cdn&#039; =&gt; url(&#039;admin/settings/cdn&#039;))) . $extra_404,
       );
     }
@@ -487,23 +487,23 @@ function advagg_check_missing_handler() 
     if ($async == -1 &amp;&amp; !$cdn_failed) {
       variable_set(&#039;advagg_async_generation&#039;, TRUE);
       $ret[&#039;advagg_async_generation&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Asynchronous Mode&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_OK,
-        &#039;value&#039;       =&gt; $t(&#039;Is now set to TRUE.&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Asynchronous Mode&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_OK,
+        &#039;value&#039; =&gt; $t(&#039;Is now set to TRUE.&#039;),
       );
     }
     if ($async == 0) {
       $ret[&#039;advagg_async_generation&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Asynchronous Mode&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-        &#039;value&#039;       =&gt; $t(&#039;Could be changed to TRUE.&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Asynchronous Mode&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+        &#039;value&#039; =&gt; $t(&#039;Could be changed to TRUE.&#039;),
       );
     }
     if ($async == 1) {
       $ret[&#039;advagg_async_generation&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Asynchronous Mode&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_OK,
-        &#039;value&#039;       =&gt; $t(&#039;Already set to TRUE&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Asynchronous Mode&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_OK,
+        &#039;value&#039; =&gt; $t(&#039;Already set to TRUE&#039;),
       );
     }
     if ($cdn_failed) {
@@ -521,11 +521,11 @@ function advagg_check_missing_handler() 
       $file = file_get_contents($directory . &#039;/.htaccess&#039;);
       if (stripos($file, &quot;RewriteEngine off&quot;) !== FALSE) {
         $ret[&#039;advagg_htaccess&#039;] = array(
-          &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Files Dir htaccess&#039;),
-          &#039;severity&#039;    =&gt; REQUIREMENT_ERROR,
-          &#039;value&#039;       =&gt; $t(&#039;The htaccess file in %dir is non standard.&#039;, array(&#039;%dir&#039; =&gt; $directory)),
+          &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Files Dir htaccess&#039;),
+          &#039;severity&#039; =&gt; REQUIREMENT_ERROR,
+          &#039;value&#039; =&gt; $t(&#039;The htaccess file in %dir is non standard.&#039;, array(&#039;%dir&#039; =&gt; $directory)),
           &#039;description&#039; =&gt; $t(&#039;You need to modify your htaccess file in your files directory. See &lt;a href=&quot;@url&quot;&gt;this link&lt;/a&gt; for more info.&#039;, array(
-            &#039;@url&#039;  =&gt; &#039;http://drupal.org/node/1171244#comment-4770544&#039;,
+            &#039;@url&#039; =&gt; &#039;http://drupal.org/node/1171244#comment-4770544&#039;,
           )),
         );
       }
@@ -534,9 +534,9 @@ function advagg_check_missing_handler() 
     // Build error message.
     if (empty($ret[&#039;advagg_htaccess&#039;])) {
       $ret[&#039;advagg_async_generation&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Asynchronous Mode&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_ERROR,
-        &#039;value&#039;       =&gt; $t(&#039;Set to FALSE.&#039;),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Asynchronous Mode&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_ERROR,
+        &#039;value&#039; =&gt; $t(&#039;Set to FALSE.&#039;),
         &#039;description&#039; =&gt; $t(&#039;Check to see if you have fast 404s, if so create an exception for this module. The &lt;a href=&quot;@readme&quot;&gt;readme file&lt;/a&gt; explains what needs to be changed. You can try flushing the menu cache as well. &#039;, array(&#039;@readme&#039; =&gt; url($readme))) . $extra_404,
       );
     }
@@ -544,21 +544,21 @@ function advagg_check_missing_handler() 
 
   // Set socket timeout relative to local round trip.
   $timeout = variable_get(&#039;advagg_socket_timeout&#039;, -1);
-  $new_time = ceil(($time_local[&#039;time&#039;]+51)/1000);
+  $new_time = ceil(($time_local[&#039;time&#039;] + 51) / 1000);
   if ($async) {
     if ($timeout == -1 || $timeout != $new_time) {
       variable_set(&#039;advagg_socket_timeout&#039;, $new_time);
       $ret[&#039;advagg_socket_timeout&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Socket Timeout&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_OK,
-        &#039;value&#039;       =&gt; $t(&#039;Set to %time seconds. Raw timer: %raw&#039;, array(&#039;%time&#039; =&gt; $new_time, &#039;%raw&#039; =&gt; $time_local[&#039;time&#039;])),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Socket Timeout&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_OK,
+        &#039;value&#039; =&gt; $t(&#039;Set to %time seconds. Raw timer: %raw&#039;, array(&#039;%time&#039; =&gt; $new_time, &#039;%raw&#039; =&gt; $time_local[&#039;time&#039;])),
       );
     }
     else {
       $ret[&#039;advagg_socket_timeout&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;Adv CSS/JS Agg - Socket Timeout&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_OK,
-        &#039;value&#039;       =&gt; $t(&#039;Already set to %time seconds. Raw timer: %raw&#039;, array(&#039;%time&#039; =&gt; $new_time, &#039;%raw&#039; =&gt; $time_local[&#039;time&#039;])),
+        &#039;title&#039; =&gt; $t(&#039;Adv CSS/JS Agg - Socket Timeout&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_OK,
+        &#039;value&#039; =&gt; $t(&#039;Already set to %time seconds. Raw timer: %raw&#039;, array(&#039;%time&#039; =&gt; $new_time, &#039;%raw&#039; =&gt; $time_local[&#039;time&#039;])),
       );
     }
   }
@@ -708,16 +708,15 @@ function advagg_schema() {
       ),
     ),
     &#039;indexes&#039; =&gt; array(
-      &#039;root&#039;        =&gt; array(&#039;root&#039;),
-      &#039;timestamp&#039;   =&gt; array(&#039;timestamp&#039;),
-      &#039;counter&#039;     =&gt; array(&#039;counter&#039;),
+      &#039;root&#039; =&gt; array(&#039;root&#039;),
+      &#039;timestamp&#039; =&gt; array(&#039;timestamp&#039;),
+      &#039;counter&#039; =&gt; array(&#039;counter&#039;),
       &#039;root_timestamp&#039; =&gt; array(
         &#039;root&#039;,
         &#039;timestamp&#039;,
       ),
     ),
-    &#039;primary key&#039;   =&gt; array(&#039;bundle_md5&#039;, &#039;filename_md5&#039;),
-
+    &#039;primary key&#039; =&gt; array(&#039;bundle_md5&#039;, &#039;filename_md5&#039;),
   );
 
   return $schema;
@@ -731,11 +730,11 @@ function advagg_update_6100() {
 
   // Add in data column
   db_add_field($ret, &#039;advagg_files&#039;, &#039;data&#039;, array(
-        &#039;description&#039; =&gt; &#039;Extra data about this file. Example would be what compressors work with it.&#039;,
-        &#039;type&#039; =&gt; &#039;text&#039;,
-        &#039;not null&#039; =&gt; TRUE,
-        &#039;size&#039; =&gt; &#039;big&#039;,
-      ));
+    &#039;description&#039; =&gt; &#039;Extra data about this file. Example would be what compressors work with it.&#039;,
+    &#039;type&#039; =&gt; &#039;text&#039;,
+    &#039;not null&#039; =&gt; TRUE,
+    &#039;size&#039; =&gt; &#039;big&#039;,
+  ));
 
   return $ret;
 }
@@ -779,11 +778,11 @@ function advagg_update_6102() {
 
   // Add in root column.
   db_add_field($ret, &#039;advagg_bundles&#039;, &#039;root&#039;, array(
-        &#039;description&#039; =&gt; &#039;If 1 then it is a root file. 0 means not root file.&#039;,
-        &#039;type&#039; =&gt; &#039;int&#039;,
-        &#039;not null&#039; =&gt; TRUE,
-        &#039;default&#039; =&gt; 0,
-      ));
+    &#039;description&#039; =&gt; &#039;If 1 then it is a root file. 0 means not root file.&#039;,
+    &#039;type&#039; =&gt; &#039;int&#039;,
+    &#039;not null&#039; =&gt; TRUE,
+    &#039;default&#039; =&gt; 0,
+  ));
 
   return $ret;
 }
@@ -825,7 +824,10 @@ function advagg_update_6105() {
   variable_del(&#039;advagg_strict_js_bundles&#039;);
   cache_clear_all(&#039;*&#039;, &#039;cache_advagg_bundle_reuse&#039;, TRUE);
   cache_clear_all(&#039;*&#039;, &#039;cache_advagg_file_builder&#039;, TRUE);
-  $ret[] = array(&#039;success&#039; =&gt; TRUE, &#039;query&#039; =&gt; &#039;advagg bundle_reuse &amp; file_builder caches flushed.&#039;);
+  $ret[] = array(
+    &#039;success&#039; =&gt; TRUE,
+    &#039;query&#039; =&gt; &#039;advagg bundle_reuse &amp; file_builder caches flushed.&#039;,
+  );
 
   return $ret;
 }
@@ -837,7 +839,10 @@ function advagg_update_6106() {
   $ret = array();
 
   cache_clear_all(&#039;*&#039;, &#039;cache_advagg_files_data&#039;, TRUE);
-  $ret[] = array(&#039;success&#039; =&gt; TRUE, &#039;query&#039; =&gt; &#039;advagg files_data cache flushed.&#039;);
+  $ret[] = array(
+    &#039;success&#039; =&gt; TRUE,
+    &#039;query&#039; =&gt; &#039;advagg files_data cache flushed.&#039;,
+  );
 
   return $ret;
 }
@@ -850,7 +855,10 @@ function advagg_update_6107() {
 
   if (db_table_exists(&#039;cache_advagg_file_builder&#039;)) {
     cache_clear_all(&#039;*&#039;, &#039;cache_advagg_file_builder&#039;, TRUE);
-    $ret[] = array(&#039;success&#039; =&gt; TRUE, &#039;query&#039; =&gt; &#039;advagg file_builder cache flushed.&#039;);
+    $ret[] = array(
+      &#039;success&#039; =&gt; TRUE,
+      &#039;query&#039; =&gt; &#039;advagg file_builder cache flushed.&#039;,
+    );
     db_drop_table($ret, &#039;cache_advagg_file_builder&#039;);
   }
 
@@ -868,11 +876,11 @@ function advagg_update_6108() {
 
   // Add in timestamp column.
   db_add_field($ret, &#039;advagg_bundles&#039;, &#039;timestamp&#039;, array(
-        &#039;description&#039; =&gt; &#039;Last used timestamp of the bundle.&#039;,
-        &#039;type&#039; =&gt; &#039;int&#039;,
-        &#039;not null&#039; =&gt; TRUE,
-        &#039;default&#039; =&gt; 0,
-      ));
+    &#039;description&#039; =&gt; &#039;Last used timestamp of the bundle.&#039;,
+    &#039;type&#039; =&gt; &#039;int&#039;,
+    &#039;not null&#039; =&gt; TRUE,
+    &#039;default&#039; =&gt; 0,
+  ));
 
   // Add in indexes.
   db_add_index($ret, &#039;advagg_bundles&#039;, &#039;root&#039;, array(&#039;root&#039;));
@@ -897,17 +905,23 @@ function advagg_update_6108() {
     else {
       $file_type_path = $js_path;
     }
-    $filepath = $file_type_path .&#039;/&#039;. $filename;
+    $filepath = $file_type_path . &#039;/&#039; . $filename;
 
     $data = cache_get($filepath, &#039;cache_advagg&#039;);
     if (!empty($data-&gt;data)) {
       // Set timestamp if it exists in the cache.
       // Not using update_sql() so we can pass in % arguments.
       db_query(&quot;UPDATE {advagg_bundles} SET timestamp = %d WHERE bundle_md5 = &#039;%s&#039;&quot;, $data-&gt;data, $row[&#039;bundle_md5&#039;]);
-      $ret[] = array(&#039;success&#039; =&gt; TRUE, &#039;query&#039; =&gt; &#039;Timestamp added for: &#039; . $filename . &#039;.&#039;);
+      $ret[] = array(
+        &#039;success&#039; =&gt; TRUE,
+        &#039;query&#039; =&gt; &#039;Timestamp added for: &#039; . $filename . &#039;.&#039;,
+      );
     }
     else {
-      $ret[] = array(&#039;success&#039; =&gt; TRUE, &#039;query&#039; =&gt; &#039;No timestamp found for: &#039; . $filename . &#039;.&#039;);
+      $ret[] = array(
+        &#039;success&#039; =&gt; TRUE,
+        &#039;query&#039; =&gt; &#039;No timestamp found for: &#039; . $filename . &#039;.&#039;,
+      );
     }
   }
 
@@ -915,7 +929,10 @@ function advagg_update_6108() {
   foreach ($cache_tables as $table) {
     cache_clear_all(&#039;*&#039;, $table, TRUE);
   }
-  $ret[] = array(&#039;success&#039; =&gt; TRUE, &#039;query&#039; =&gt; &#039;AdvAgg Caches Flushed.&#039;);
+  $ret[] = array(
+    &#039;success&#039; =&gt; TRUE,
+    &#039;query&#039; =&gt; &#039;AdvAgg Caches Flushed.&#039;,
+  );
 
   return $ret;
 }
@@ -931,11 +948,11 @@ function advagg_update_6109() {
 
   // Add in timestamp column.
   db_add_field($ret, &#039;advagg_files&#039;, &#039;filesize&#039;, array(
-        &#039;description&#039; =&gt; &#039;The filesize of the file in bytes.&#039;,
-        &#039;type&#039; =&gt; &#039;int&#039;,
-        &#039;not null&#039; =&gt; TRUE,
-        &#039;default&#039; =&gt; 0,
-      ));
+    &#039;description&#039; =&gt; &#039;The filesize of the file in bytes.&#039;,
+    &#039;type&#039; =&gt; &#039;int&#039;,
+    &#039;not null&#039; =&gt; TRUE,
+    &#039;default&#039; =&gt; 0,
+  ));
 
   // Add in an index.
   db_add_index($ret, &#039;advagg_files&#039;, &#039;filesize&#039;, array(&#039;filesize&#039;));
@@ -950,11 +967,17 @@ function advagg_update_6109() {
       if (!empty($size)) {
         db_query(&quot;UPDATE {advagg_files} SET filesize = %d WHERE filename_md5 = &#039;%s&#039;&quot;, $size, $row[&#039;filename_md5&#039;]);
         $updated = TRUE;
-        $ret[] = array(&#039;success&#039; =&gt; TRUE, &#039;query&#039; =&gt; &#039;Filesize added for: &#039; . $row[&#039;filename&#039;] . &#039;.&#039;);
+        $ret[] = array(
+          &#039;success&#039; =&gt; TRUE,
+          &#039;query&#039; =&gt; &#039;Filesize added for: &#039; . $row[&#039;filename&#039;] . &#039;.&#039;,
+        );
       }
     }
     if (!$updated) {
-      $ret[] = array(&#039;success&#039; =&gt; FALSE, &#039;query&#039; =&gt; &#039;Could not get the filesize for for: &#039; . $row[&#039;filename&#039;] . &#039;.&#039;);
+      $ret[] = array(
+        &#039;success&#039; =&gt; FALSE,
+        &#039;query&#039; =&gt; &#039;Could not get the filesize for for: &#039; . $row[&#039;filename&#039;] . &#039;.&#039;,
+      );
     }
   }
 
diff -up -r advagg.missing.inc advagg.missing.inc
--- advagg.missing.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg.missing.inc	2012-03-23 13:02:15.000000000 -0600
@@ -88,14 +88,14 @@ function advagg_missing_regenerate() {
     $file_type_path = $css_path;
   }
   $new_filename = advagg_build_filename($type, $md5, $counter);
-  $filepath = $file_type_path .&#039;/&#039;. $new_filename;
+  $filepath = $file_type_path . &#039;/&#039; . $new_filename;
 
   // Only process if we got an older counter.
   // If we have an out of range counter see if a simlar file exists and serve
   // that up.
   if ($counter &gt; $counter_in_db || $counter &lt; 0) {
     $new_filename = advagg_build_filename($type, $md5, $counter_in_db);
-    $filepath = $file_type_path .&#039;/&#039;. $new_filename;
+    $filepath = $file_type_path . &#039;/&#039; . $new_filename;
     advagg_missing_send_file($filepath, advagg_build_uri($filepath), $type);
     exit;
   }
@@ -201,7 +201,7 @@ function advagg_missing_remove_cache($bu
   if (!empty($filenames)) {
     foreach ($filenames as $key =&gt; $info) {
       $filename = $info[&#039;filename&#039;];
-      $filepath = $file_type_path .&#039;/&#039;. $filename;
+      $filepath = $file_type_path . &#039;/&#039; . $filename;
 
       cache_set($filepath, FALSE, &#039;cache_advagg&#039;, TRUE);
     }
@@ -228,7 +228,7 @@ function advagg_missing_async_opp($outpu
   // Calculate Content Length
   if ($length == 0) {
     $output .= &quot;\n&quot;;
-    $length = (advagg_missing_strlen($output)-1);
+    $length = (advagg_missing_strlen($output) -1);
   }
   // Prime php for background operations
   $loop = 0;
@@ -342,8 +342,8 @@ function advagg_missing_file_create_path
       return $dest;
     }
     // Not found, try again with prefixed directory path.
-    else if (file_check_location($file_path .&#039;/&#039;. $dest, $file_path)) {
-      return $file_path .&#039;/&#039;. $dest;
+    else if (file_check_location($file_path . &#039;/&#039; . $dest, $file_path)) {
+      return $file_path . &#039;/&#039; . $dest;
     }
   }
   // File not found.
diff -up -r advagg.module advagg.module
--- advagg.module	2012-03-23 12:08:13.000000000 -0600
+++ advagg.module	2012-03-23 13:02:17.000000000 -0600
@@ -162,14 +162,14 @@ if (variable_get(&#039;advagg_closure&#039;, ADVAG
   if (!function_exists(&#039;phptemplate_closure&#039;)) {
 
     /**
-    * Execute hook_footer() which is run at the end of the page right before
-    * the close of the body tag.
-    *
-    * @param $main (optional)
-    *   Whether the current page is the front page of the site.
-    * @return
-    *   A string containing the results of the hook_footer() calls.
-    */
+     * Execute hook_footer() which is run at the end of the page right before
+     * the close of the body tag.
+     *
+     * @param $main (optional)
+     *   Whether the current page is the front page of the site.
+     * @return
+     *   A string containing the results of the hook_footer() calls.
+     */
     function phptemplate_closure($main = 0) {
       global $_advagg;
       $_advagg[&#039;closure&#039;] = TRUE;
@@ -292,7 +292,7 @@ function advagg_cron() {
   // Set the oldest file/bundle to keep at 2 weeks.
   $max_time = module_exists(&#039;advagg_bundler&#039;) ? variable_get(&#039;advagg_bundler_outdated&#039;, ADVAGG_BUNDLER_OUTDATED) : 1209600;
   $max_file_time = time() - $max_time;
-  $max_bundle_time = time() - ($max_time*3);
+  $max_bundle_time = time() - ($max_time * 3);
   $bundles_removed = 0;
   $files_removed = array();
 
@@ -384,8 +384,8 @@ function advagg_theme_registry_alter(&amp;$t
 
     // If ctools hasn&#039;t been patched remove it from getting pre-processed.
     if (   !empty($_advagg[&#039;ctools_patched&#039;])
-        &amp;&amp; module_exists(&#039;ctools&#039;)
-        &amp;&amp; $key = array_search(&#039;ctools_ajax_page_preprocess&#039;, $theme_registry[&#039;page&#039;][&#039;preprocess functions&#039;])
+         &amp;&amp; module_exists(&#039;ctools&#039;)
+         &amp;&amp; $key = array_search(&#039;ctools_ajax_page_preprocess&#039;, $theme_registry[&#039;page&#039;][&#039;preprocess functions&#039;])
           ) {
       unset($theme_registry[&#039;page&#039;][&#039;preprocess functions&#039;][$key]);
     }
@@ -545,30 +545,30 @@ function advagg_string_ends_with($haysta
   // Define substr_compare if it doesn&#039;t exist (PHP 4 fix).
   if (!function_exists(&#039;substr_compare&#039;)) {
     /**
-    * Binary safe comparison of two strings from an offset, up to length
-    * characters.
-    *
-    * Compares main_str from position offset with str up to length characters.
-    * @see http://php.net/substr-compare#53084
-    *
-    * @param $main_str
-    *   The main string being compared.
-    * @param $str
-    *   The secondary string being compared.
-    * @param $offset
-    *   The start position for the comparison. If negative, it starts counting
-    *   from the end of the string.
-    * @param $length
-    *   The length of the comparison. The default value is the largest of the
-    *   length of the str compared to the length of main_str less the offset.
-    * @param $case_insensitivity
-    *   If TRUE, comparison is case insensitive.
-    * @return
-    *   Returns &lt; 0 if main_str from position offset is less than str, &gt; 0 if
-    *   it is greater than str, and 0 if they are equal. If offset is equal to
-    *   or greater than the length of main_str or length is set and is less than
-    *   1, substr_compare() prints a warning and returns FALSE.
-    */
+     * Binary safe comparison of two strings from an offset, up to length
+     * characters.
+     *
+     * Compares main_str from position offset with str up to length characters.
+     * @see http://php.net/substr-compare#53084
+     *
+     * @param $main_str
+     *   The main string being compared.
+     * @param $str
+     *   The secondary string being compared.
+     * @param $offset
+     *   The start position for the comparison. If negative, it starts counting
+     *   from the end of the string.
+     * @param $length
+     *   The length of the comparison. The default value is the largest of the
+     *   length of the str compared to the length of main_str less the offset.
+     * @param $case_insensitivity
+     *   If TRUE, comparison is case insensitive.
+     * @return
+     *   Returns &lt; 0 if main_str from position offset is less than str, &gt; 0 if
+     *   it is greater than str, and 0 if they are equal. If offset is equal to
+     *   or greater than the length of main_str or length is set and is less than
+     *   1, substr_compare() prints a warning and returns FALSE.
+     */
     function substr_compare($main_str, $str, $offset, $length = NULL, $case_insensitivity = FALSE) {
       $offset = (int) $offset;
 
@@ -608,7 +608,7 @@ function advagg_string_ends_with($haysta
   if ($needle_len &gt; $haystack_len) {
     return FALSE;
   }
-  return substr_compare($haystack, $needle, $haystack_len-$needle_len, $needle_len, TRUE) === 0;
+  return substr_compare($haystack, $needle, $haystack_len -$needle_len, $needle_len, TRUE) === 0;
 }
 
 /**
@@ -830,7 +830,7 @@ function advagg_jquery_updater(&amp;$js) {
   unset($js[&#039;core&#039;][&#039;misc/jquery.js&#039;]);
 
   // Loop through each of the required replacements.
-  $replacement_path = drupal_get_path(&#039;module&#039;, &#039;jquery_update&#039;) .&#039;/replace/&#039;;
+  $replacement_path = drupal_get_path(&#039;module&#039;, &#039;jquery_update&#039;) . &#039;/replace/&#039;;
   foreach (jquery_update_get_replacements() as $type =&gt; $replacements) {
     foreach ($replacements as $find =&gt; $replace) {
       // If the file to replace is loaded on this page...
@@ -1085,7 +1085,10 @@ function advagg_find_existing_bundle(&amp;$f
     // Make sure bundle has the same number of files if using strict matching.
     if (!empty($count) &amp;&amp; $count == $files_count) {
       $bundle_md5 = $new_md5;
-      $data = array(array(&#039;files&#039; =&gt; $files, &#039;bundle_md5&#039; =&gt; $bundle_md5));
+      $data = array(array(
+          &#039;files&#039; =&gt; $files,
+          &#039;bundle_md5&#039; =&gt; $bundle_md5,
+        ));
       cache_set($cached_data_key, $data, &#039;cache_advagg_bundle_reuse&#039;, CACHE_TEMPORARY);
       return;
     }
@@ -1487,7 +1490,7 @@ function advagg_get_bundle_from_filename
   $type = substr($filename, 0, strpos($filename, &#039;_&#039;));
 
   // Get extension
-  $ext = substr($filename, strpos($filename, &#039;.&#039;, 37)+1);
+  $ext = substr($filename, strpos($filename, &#039;.&#039;, 37) + 1);
 
   // Make sure extension is the same as the type.
   if ($ext != $type) {
@@ -1497,11 +1500,11 @@ function advagg_get_bundle_from_filename
   // Extract info from wanted filename.
   if ($type == &#039;css&#039;) {
     $md5 = substr($filename, 4, 32);
-    $counter = substr($filename, 37, strpos($filename, &#039;.&#039;, 38)-37);
+    $counter = substr($filename, 37, strpos($filename, &#039;.&#039;, 38) -37);
   }
   elseif ($type == &#039;js&#039;) {
     $md5 = substr($filename, 3, 32);
-    $counter = substr($filename, 36, strpos($filename, &#039;.&#039;, 37)-36);
+    $counter = substr($filename, 36, strpos($filename, &#039;.&#039;, 37) -36);
   }
   else {
     return t(&#039;Wrong file type.&#039;);
@@ -1818,7 +1821,7 @@ function advagg_process_css_js_prep($noa
   // browser-caching. The string changes on every update or full cache
   // flush, forcing browsers to load a new copy of the files, as the
   // URL changed.
-  $query_string = &#039;?&#039;. substr(variable_get(&#039;css_js_query_string&#039;, &#039;0&#039;), 0, 1);
+  $query_string = &#039;?&#039; . substr(variable_get(&#039;css_js_query_string&#039;, &#039;0&#039;), 0, 1);
 
   return array($preprocess, $public_downloads, $query_string);
 }
@@ -2114,8 +2117,8 @@ function advagg_unlimited_css_builder($e
       // Test for versions &gt; 1.5
       // Test for Pocket IE
       if (   stristr($_SERVER[&#039;HTTP_USER_AGENT&#039;], &#039;microsoft internet explorer&#039;)
-          || stristr($_SERVER[&#039;HTTP_USER_AGENT&#039;], &#039;msie&#039;)
-          || stristr($_SERVER[&#039;HTTP_USER_AGENT&#039;], &#039;mspie&#039;)
+           || stristr($_SERVER[&#039;HTTP_USER_AGENT&#039;], &#039;msie&#039;)
+           || stristr($_SERVER[&#039;HTTP_USER_AGENT&#039;], &#039;mspie&#039;)
           ) {
         $is_ie = TRUE;
       }
@@ -2165,19 +2168,19 @@ function advagg_unlimited_css_traditiona
     if (isset($css_file[&#039;href&#039;])) {
       $href = $css_file[&#039;href&#039;];
       if ($prefix != $last_prefix) {
-        $styles .= $last_suffix . &quot;\n&quot; . $prefix . &#039;&lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; media=&quot;&#039;. $media .&#039;&quot; href=&quot;&#039;. $href . &#039;&quot; /&gt;&#039; . &quot;\n&quot;;
+        $styles .= $last_suffix . &quot;\n&quot; . $prefix . &#039;&lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; media=&quot;&#039; . $media . &#039;&quot; href=&quot;&#039; . $href . &#039;&quot; /&gt;&#039; . &quot;\n&quot;;
       }
       else {
-        $styles .= &#039;&lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; media=&quot;&#039;. $media .&#039;&quot; href=&quot;&#039;. $href . &#039;&quot; /&gt;&#039; . &quot;\n&quot;;
+        $styles .= &#039;&lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; media=&quot;&#039; . $media . &#039;&quot; href=&quot;&#039; . $href . &#039;&quot; /&gt;&#039; . &quot;\n&quot;;
       }
     }
     else {
       $data = $css_file[&#039;data&#039;];
       if ($prefix != $last_prefix) {
-        $styles .= $last_suffix . &quot;\n&quot; . $prefix . &#039;&lt;style type=&quot;text/css&quot; media=&quot;&#039;. $media .&#039;&quot;&gt;&#039; . &quot;\n&quot; . $data . &quot;\n&quot; . &#039;&lt;/style&gt;&#039; . &quot;\n&quot;;
+        $styles .= $last_suffix . &quot;\n&quot; . $prefix . &#039;&lt;style type=&quot;text/css&quot; media=&quot;&#039; . $media . &#039;&quot;&gt;&#039; . &quot;\n&quot; . $data . &quot;\n&quot; . &#039;&lt;/style&gt;&#039; . &quot;\n&quot;;
       }
       else {
-        $styles .= &#039;&lt;style type=&quot;text/css&quot; media=&quot;&#039;. $media .&#039;&quot;&gt;&#039; . &quot;\n&quot; . $data . &quot;\n&quot; . &#039;&lt;/style&gt;&#039; . &quot;\n&quot;;
+        $styles .= &#039;&lt;style type=&quot;text/css&quot; media=&quot;&#039; . $media . &#039;&quot;&gt;&#039; . &quot;\n&quot; . $data . &quot;\n&quot; . &#039;&lt;/style&gt;&#039; . &quot;\n&quot;;
       }
     }
     $last_prefix = $prefix;
@@ -2203,17 +2206,17 @@ function advagg_unlimited_css_import($fi
     $href = $css_file[&#039;href&#039;];
     if ($media_new != $media || $counter &gt; variable_get(&#039;advagg_css_count_threshold&#039;, ADVAGG_CSS_COUNT_THRESHOLD)) {
       if ($media &amp;&amp; !empty($import)) {
-        $styles .= &quot;\n&quot; . &#039;&lt;style type=&quot;text/css&quot; media=&quot;&#039;. $media .&#039;&quot;&gt;&#039; . &quot;\n&quot;. $import .&#039;&lt;/style&gt;&#039;;
+        $styles .= &quot;\n&quot; . &#039;&lt;style type=&quot;text/css&quot; media=&quot;&#039; . $media . &#039;&quot;&gt;&#039; . &quot;\n&quot; . $import . &#039;&lt;/style&gt;&#039;;
         $import = &#039;&#039;;
       }
       $counter = 0;
       $media = $media_new;
     }
-    $import .= &#039;@import &quot;&#039;. $href .&#039;&quot;;&#039;.&quot;\n&quot;;
+    $import .= &#039;@import &quot;&#039; . $href . &#039;&quot;;&#039; . &quot;\n&quot;;
     $counter++;
   }
   if ($media &amp;&amp; !empty($import)) {
-    $styles .= &quot;\n&quot;.&#039;&lt;style type=&quot;text/css&quot; media=&quot;&#039;. $media .&#039;&quot;&gt;&#039;.&quot;\n&quot;. $import .&#039;&lt;/style&gt;&#039;;
+    $styles .= &quot;\n&quot; . &#039;&lt;style type=&quot;text/css&quot; media=&quot;&#039; . $media . &#039;&quot;&gt;&#039; . &quot;\n&quot; . $import . &#039;&lt;/style&gt;&#039;;
   }
 }
 
@@ -2269,7 +2272,11 @@ function advagg_process_js($master_set, 
     $setting_no_preprocess = array();
     $inline_no_preprocess = array();
     $external_no_preprocess = array();
-    $output_no_preprocess = array(&#039;core&#039; =&gt; array(), &#039;module&#039; =&gt; array(), &#039;theme&#039; =&gt; array());
+    $output_no_preprocess = array(
+      &#039;core&#039; =&gt; array(),
+      &#039;module&#039; =&gt; array(),
+      &#039;theme&#039; =&gt; array(),
+    );
     $output_preprocess = array();
     $preprocess_list = array();
     $js_settings_array = array();
@@ -2325,7 +2332,7 @@ function advagg_process_js($master_set, 
           // Additionally, go through any remaining scripts if JS preprocessing is on and output the non-cached ones.
           foreach ($data as $path =&gt; $info) {
             if (!$info[&#039;preprocess&#039;] || !$public_downloads || !$preprocess_js) {
-              $output_no_preprocess[$type][] = array(advagg_build_uri($path) . ($info[&#039;cache&#039;] ? $query_string : &#039;?&#039;. time()), $info[&#039;defer&#039;], $info[&#039;prefix&#039;], $info[&#039;suffix&#039;]);
+              $output_no_preprocess[$type][] = array(advagg_build_uri($path) . ($info[&#039;cache&#039;] ? $query_string : &#039;?&#039; . time()), $info[&#039;defer&#039;], $info[&#039;prefix&#039;], $info[&#039;suffix&#039;]);
               $files_included[$path] = $info[&#039;preprocess&#039;];
             }
             else {
@@ -2425,22 +2432,22 @@ function advagg_js_builder($external_no_
 
   if (!empty($external_no_preprocess)) {
     foreach ($external_no_preprocess as $values) {
-      list ($src, $defer, $prefix, $suffix) = $values;
-      $output .= $prefix . &#039;&lt;script type=&quot;text/javascript&quot;&#039;. ($defer ? &#039; defer=&quot;defer&quot;&#039; : &#039;&#039;) . &#039; src=&quot;&#039;. $src . &#039;&quot;&gt;&lt;/script&gt;&#039; . $suffix . &quot;\n&quot;;
+      list($src, $defer, $prefix, $suffix) = $values;
+      $output .= $prefix . &#039;&lt;script type=&quot;text/javascript&quot;&#039; . ($defer ? &#039; defer=&quot;defer&quot;&#039; : &#039;&#039;) . &#039; src=&quot;&#039; . $src . &#039;&quot;&gt;&lt;/script&gt;&#039; . $suffix . &quot;\n&quot;;
     }
   }
 
   if (!empty($output_preprocess)) {
     foreach ($output_preprocess as $values) {
-      list ($src, $prefix, $suffix) = $values;
-      $output .= $prefix . &#039;&lt;script type=&quot;text/javascript&quot; src=&quot;&#039;. $src .&#039;&quot;&gt;&lt;/script&gt;&#039; . $suffix . &quot;\n&quot;;
+      list($src, $prefix, $suffix) = $values;
+      $output .= $prefix . &#039;&lt;script type=&quot;text/javascript&quot; src=&quot;&#039; . $src . &#039;&quot;&gt;&lt;/script&gt;&#039; . $suffix . &quot;\n&quot;;
     }
   }
 
   foreach ($output_no_preprocess as $type =&gt; $list) {
     if (!empty($list)) {
       foreach ($list as $values) {
-        list ($src, $defer, $prefix, $suffix) = $values;
+        list($src, $defer, $prefix, $suffix) = $values;
         $output .= $prefix . &#039;&lt;script type=&quot;text/javascript&quot;&#039; . ($defer ? &#039; defer=&quot;defer&quot;&#039; : &#039;&#039;) . &#039; src=&quot;&#039; . $src . &#039;&quot;&gt;&lt;/script&gt;&#039; . $suffix . &quot;\n&quot;;
       }
     }
@@ -2454,8 +2461,8 @@ function advagg_js_builder($external_no_
 
   if (!empty($inline_no_preprocess)) {
     foreach ($inline_no_preprocess as $values) {
-      list ($code, $defer, $prefix, $suffix) = $values;
-      $output .= $prefix . &#039;&lt;script type=&quot;text/javascript&quot;&#039;. ($defer ? &#039; defer=&quot;defer&quot;&#039; : &#039;&#039;) .&#039;&gt;&#039; . $embed_prefix . $code . $embed_suffix . &#039;&lt;/script&gt;&#039; . $suffix . &quot;\n&quot;;
+      list($code, $defer, $prefix, $suffix) = $values;
+      $output .= $prefix . &#039;&lt;script type=&quot;text/javascript&quot;&#039; . ($defer ? &#039; defer=&quot;defer&quot;&#039; : &#039;&#039;) . &#039;&gt;&#039; . $embed_prefix . $code . $embed_suffix . &#039;&lt;/script&gt;&#039; . $suffix . &quot;\n&quot;;
     }
   }
 
@@ -2555,7 +2562,7 @@ function advagg_css_js_file_builder($typ
     $bundle_md5 = $info[&#039;bundle_md5&#039;];
     $prefix = &#039;&#039;;
     $suffix = &#039;&#039;;
-    $filepath = $file_type_path .&#039;/&#039;. $filename;
+    $filepath = $file_type_path . &#039;/&#039; . $filename;
 
     // Invoke hook_advagg_js_extra_alter() or hook_advagg_css_extra_alter to
     // give installed modules a chance to modify the prefix or suffix for a
@@ -2592,13 +2599,21 @@ function advagg_css_js_file_builder($typ
         // Return filepath if we are going to wait for the bundle to be
         // generated or if the bundle already exists.
         if (variable_get(&#039;advagg_aggregate_mode&#039;, ADVAGG_AGGREGATE_MODE) &lt; 2 || advagg_bundle_built($filepath)) {
-          $output[$filepath] = array(&#039;prefix&#039; =&gt; $prefix, &#039;suffix&#039; =&gt; $suffix, &#039;files&#039; =&gt; array_map(&#039;advagg_return_true&#039;, array_flip($files)));
+          $output[$filepath] = array(
+            &#039;prefix&#039; =&gt; $prefix,
+            &#039;suffix&#039; =&gt; $suffix,
+            &#039;files&#039; =&gt; array_map(&#039;advagg_return_true&#039;, array_flip($files)),
+          );
         }
         else {
           // Aggregate isn&#039;t built yet, send back the files that where going to
           // be in it.
           foreach ($files as $file) {
-            $output[$file . $query_string] = array(&#039;prefix&#039; =&gt; &#039;&#039;, &#039;suffix&#039; =&gt; &#039;&#039;, &#039;files&#039; =&gt; array($file . $query_string =&gt; TRUE));
+            $output[$file . $query_string] = array(
+              &#039;prefix&#039; =&gt; &#039;&#039;,
+              &#039;suffix&#039; =&gt; &#039;&#039;,
+              &#039;files&#039; =&gt; array($file . $query_string =&gt; TRUE),
+            );
           }
           $cacheable = FALSE;
           advagg_disable_page_cache();
@@ -2611,13 +2626,21 @@ function advagg_css_js_file_builder($typ
       if (!lock_acquire($lock_name)) {
         if (variable_get(&#039;advagg_aggregate_mode&#039;, ADVAGG_AGGREGATE_MODE) == 0 ) {
           $locks[] = array($lock_name =&gt; $filepath);
-          $output[$filepath] = array(&#039;prefix&#039; =&gt; $prefix, &#039;suffix&#039; =&gt; $suffix, &#039;files&#039; =&gt; array_map(&#039;advagg_return_true&#039;, array_flip($files)));
+          $output[$filepath] = array(
+            &#039;prefix&#039; =&gt; $prefix,
+            &#039;suffix&#039; =&gt; $suffix,
+            &#039;files&#039; =&gt; array_map(&#039;advagg_return_true&#039;, array_flip($files)),
+          );
         }
         else {
           // Aggregate isn&#039;t built yet, send back the files that where going
           // to be in it.
           foreach ($files as $file) {
-            $output[$file . $query_string] = array(&#039;prefix&#039; =&gt; &#039;&#039;, &#039;suffix&#039; =&gt; &#039;&#039;, &#039;files&#039; =&gt; array($file . $query_string =&gt; TRUE));
+            $output[$file . $query_string] = array(
+              &#039;prefix&#039; =&gt; &#039;&#039;,
+              &#039;suffix&#039; =&gt; &#039;&#039;,
+              &#039;files&#039; =&gt; array($file . $query_string =&gt; TRUE),
+            );
           }
           $cacheable = FALSE;
           advagg_disable_page_cache();
@@ -2664,7 +2687,11 @@ function advagg_css_js_file_builder($typ
     else {
       $files_used = array_merge($files_used, $files);
     }
-    $output[$filepath] = array(&#039;prefix&#039; =&gt; $prefix, &#039;suffix&#039; =&gt; $suffix, &#039;files&#039; =&gt; array_map(&#039;advagg_return_true&#039;, array_flip($files)));
+    $output[$filepath] = array(
+      &#039;prefix&#039; =&gt; $prefix,
+      &#039;suffix&#039; =&gt; $suffix,
+      &#039;files&#039; =&gt; array_map(&#039;advagg_return_true&#039;, array_flip($files)),
+    );
   }
 
   // Wait for all locks before returning.
@@ -2708,7 +2735,7 @@ function advagg_build_css_bundle($files)
   foreach ($files as $file) {
     $contents = drupal_load_stylesheet($file, TRUE);
     // Return the path to where this CSS file originated from.
-    $base = base_path() . dirname($file) .&#039;/&#039;;
+    $base = base_path() . dirname($file) . &#039;/&#039;;
     _drupal_build_css_path(NULL, $base);
     // Prefix all paths within this CSS file, ignoring external and absolute paths.
     $data .= preg_replace_callback(&#039;/url\([\&#039;&quot;]?(?![a-z]+:|\/+)([^\&#039;&quot;)]+)[\&#039;&quot;]?\)/i&#039;, &#039;_drupal_build_css_path&#039;, $contents);
@@ -2740,7 +2767,7 @@ function advagg_build_js_bundle($files) 
   foreach ($files as $file) {
     // Append a &#039;;&#039; and a newline after each JS file to prevent them from running together.
     if (advagg_file_exists($file)) {
-      $data .= file_get_contents($file) .&quot;;\n&quot;;
+      $data .= file_get_contents($file) . &quot;;\n&quot;;
     }
   }
   return $data;
@@ -3039,7 +3066,7 @@ function advagg_drupal_to_js($var) {
       foreach ($var as $k =&gt; $v) {
         $output[] = advagg_drupal_to_js(strval($k)) . &#039;: &#039; . advagg_drupal_to_js($v);
       }
-      return &#039;{ &#039; . implode(&#039;, &#039;, $output) .&#039; }&#039;;
+      return &#039;{ &#039; . implode(&#039;, &#039;, $output) . &#039; }&#039;;
     default:
       return &#039;null&#039;;
   }
@@ -3126,7 +3153,7 @@ function _advagg_drupal_load_stylesheet(
   // Alter all internal url() paths. Leave external paths alone. We don&#039;t need
   // to normalize absolute paths here (i.e. remove folder/... segments) because
   // that will be done later.
-  return preg_replace(&#039;/url\(\s*([\&#039;&quot;]?)(?![a-z]+:|\/+)/i&#039;, &#039;url(\1&#039;. $directory, $file);
+  return preg_replace(&#039;/url\(\s*([\&#039;&quot;]?)(?![a-z]+:|\/+)/i&#039;, &#039;url(\1&#039; . $directory, $file);
 }
 
 /**
@@ -3219,7 +3246,7 @@ function advagg_async_connect_http_reque
 
   $flags = STREAM_CLIENT_CONNECT;
   if (variable_get(&#039;advagg_async_socket_connect&#039;, ADVAGG_ASYNC_SOCKET_CONNECT)) {
-    $flags = STREAM_CLIENT_ASYNC_CONNECT|STREAM_CLIENT_CONNECT;
+    $flags = STREAM_CLIENT_ASYNC_CONNECT | STREAM_CLIENT_CONNECT;
   }
   if (empty($options[&#039;context&#039;])) {
     $fp = @stream_socket_client($socket, $errno, $errstr, $options[&#039;timeout&#039;], $flags);
@@ -3301,7 +3328,7 @@ function advagg_async_connect_http_reque
  *   (optional) A file pointer.
  * @param $request
  *   (optional) A string containing the request headers to send to the server.
-  * @param $timeout
+ * @param $timeout
  *   (optional) An integer holding the stream timeout value.
  * @return bool
  *   TRUE if function worked as planed.
@@ -3441,7 +3468,7 @@ function advagg_ctools_process_js_files(
   // them into account so we don&#039;t double-load scripts.
   static $replacements = NULL;
   if (!isset($replacements)) {
-  $replacements = module_invoke_all(&#039;js_replacements&#039;);
+    $replacements = module_invoke_all(&#039;js_replacements&#039;);
   }
 
   $settings = array();
@@ -3546,7 +3573,7 @@ function advagg_get_js_css_get_array($js
   // Setup variables.
   $variables = array(
     &#039;css&#039; =&gt; array(),
-    &#039;js&#039;  =&gt; array(),
+    &#039;js&#039; =&gt; array(),
   );
   // Setup render functions.
   $css_function = variable_get(&#039;advagg_css_render_function&#039;, ADVAGG_CSS_RENDER_FUNCTION);
@@ -3632,9 +3659,9 @@ function advagg_get_js_css_get_array($js
  */
 function advagg_css_array($external_no_preprocess, $module_no_preprocess, $output_no_preprocess, $output_preprocess, $theme_no_preprocess, $inline_no_preprocess, $inline_included, $files_included, $files_aggregates_included) {
   return array(
-    &#039;inline&#039;            =&gt; $inline_included,
-    &#039;files&#039;             =&gt; $files_included,
-    &#039;files_aggregates&#039;  =&gt; $files_aggregates_included,
+    &#039;inline&#039; =&gt; $inline_included,
+    &#039;files&#039; =&gt; $files_included,
+    &#039;files_aggregates&#039; =&gt; $files_aggregates_included,
   );
 }
 
@@ -3666,10 +3693,10 @@ function advagg_css_array($external_no_p
  */
 function advagg_js_array($external_no_preprocess, $output_preprocess, $output_no_preprocess, $setting_no_preprocess, $inline_no_preprocess, $scope, $js_settings_array, $inline_included, $files_included, $files_aggregates_included) {
   return array(
-    &#039;settings&#039;          =&gt; $js_settings_array,
-    &#039;inline&#039;            =&gt; $inline_included,
-    &#039;files&#039;             =&gt; $files_included,
-    &#039;files_aggregates&#039;  =&gt; $files_aggregates_included,
+    &#039;settings&#039; =&gt; $js_settings_array,
+    &#039;inline&#039; =&gt; $inline_included,
+    &#039;files&#039; =&gt; $files_included,
+    &#039;files_aggregates&#039; =&gt; $files_aggregates_included,
   );
 }
 
@@ -3723,7 +3750,7 @@ function _advagg_build_url($filepath = &#039;
   // Server auth.
   $auth = &#039;&#039;;
   if (isset($_SERVER[&#039;AUTH_TYPE&#039;]) &amp;&amp; $_SERVER[&#039;AUTH_TYPE&#039;] == &#039;Basic&#039;) {
-    $auth = $_SERVER[&#039;PHP_AUTH_USER&#039;] . &#039;:&#039; . $_SERVER[&#039;PHP_AUTH_PW&#039;] .&#039;@&#039;;
+    $auth = $_SERVER[&#039;PHP_AUTH_USER&#039;] . &#039;:&#039; . $_SERVER[&#039;PHP_AUTH_PW&#039;] . &#039;@&#039;;
   }
 
   // Host.
diff -up -r advagg_bundler/advagg_bundler.admin.inc advagg_bundler/advagg_bundler.admin.inc
--- advagg_bundler/advagg_bundler.admin.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_bundler/advagg_bundler.admin.inc	2012-03-23 13:02:17.000000000 -0600
@@ -23,10 +23,10 @@ function advagg_bundler_admin_settings_f
   $form = array();
 
   $form[&#039;advagg_bundler_active&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Bundler is Active&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_bundler_active&#039;, ADVAGG_BUNDLER_ACTIVE),
- &#039;#description&#039;    =&gt; t(&#039;If not checked, the bundler will passively monitor your site, but it will not split up aggregates.&#039;),
+    &#039;#type&#039; =&gt; &#039;checkbox&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Bundler is Active&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_bundler_active&#039;, ADVAGG_BUNDLER_ACTIVE),
+    &#039;#description&#039; =&gt; t(&#039;If not checked, the bundler will passively monitor your site, but it will not split up aggregates.&#039;),
   );
 
   $options = array(
@@ -43,25 +43,25 @@ function advagg_bundler_admin_settings_f
     10 =&gt; 10,
   );
   $form[&#039;advagg_bundler_max_css&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;select&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Max Number Of CSS Bundles Per Page&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_bundler_max_css&#039;, ADVAGG_BUNDLER_MAX_CSS),
-    &#039;#options&#039;        =&gt; $options,
-    &#039;#description&#039;    =&gt; t(&#039;If 0 is selected then the bundler is disabled&#039;),
+    &#039;#type&#039; =&gt; &#039;select&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Max Number Of CSS Bundles Per Page&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_bundler_max_css&#039;, ADVAGG_BUNDLER_MAX_CSS),
+    &#039;#options&#039; =&gt; $options,
+    &#039;#description&#039; =&gt; t(&#039;If 0 is selected then the bundler is disabled&#039;),
   );
   $form[&#039;advagg_bundler_max_js&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;select&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Max Number Of JS Bundles Per Page&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_bundler_max_js&#039;, ADVAGG_BUNDLER_MAX_JS),
-    &#039;#options&#039;        =&gt; $options,
-    &#039;#description&#039;    =&gt; t(&#039;If 0 is selected then the bundler is disabled&#039;),
+    &#039;#type&#039; =&gt; &#039;select&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Max Number Of JS Bundles Per Page&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_bundler_max_js&#039;, ADVAGG_BUNDLER_MAX_JS),
+    &#039;#options&#039; =&gt; $options,
+    &#039;#description&#039; =&gt; t(&#039;If 0 is selected then the bundler is disabled&#039;),
   );
 
   $form[&#039;info&#039;] = array(
-    &#039;#type&#039;          =&gt; &#039;fieldset&#039;,
-    &#039;#collapsible&#039;   =&gt; TRUE,
-    &#039;#collapsed&#039;     =&gt; TRUE,
-    &#039;#title&#039;         =&gt; t(&#039;Raw Grouping Info&#039;),
+    &#039;#type&#039; =&gt; &#039;fieldset&#039;,
+    &#039;#collapsible&#039; =&gt; TRUE,
+    &#039;#collapsed&#039; =&gt; TRUE,
+    &#039;#title&#039; =&gt; t(&#039;Raw Grouping Info&#039;),
   );
   module_load_include(&#039;inc&#039;, &#039;advagg&#039;, &#039;advagg.admin&#039;);
   $analysis = advagg_bundler_analysis(&#039;&#039;, TRUE);
@@ -74,10 +74,10 @@ function advagg_bundler_admin_settings_f
 
   list($rawtext, $rows) = advagg_form_print_r($data);
   $form[&#039;info&#039;][&#039;advagg_bundler_info&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;textarea&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;%count different groupings&#039;, array(&#039;%count&#039; =&gt; count($data))),
-    &#039;#default_value&#039;  =&gt; $rawtext,
-    &#039;#rows&#039;           =&gt; $rows-1,
+    &#039;#type&#039; =&gt; &#039;textarea&#039;,
+    &#039;#title&#039; =&gt; t(&#039;%count different groupings&#039;, array(&#039;%count&#039; =&gt; count($data))),
+    &#039;#default_value&#039; =&gt; $rawtext,
+    &#039;#rows&#039; =&gt; $rows -1,
   );
 
   return system_settings_form($form);
diff -up -r advagg_css_compress/advagg_css_compress.admin.inc advagg_css_compress/advagg_css_compress.admin.inc
--- advagg_css_compress/advagg_css_compress.admin.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/advagg_css_compress.admin.inc	2012-03-23 13:02:17.000000000 -0600
@@ -23,51 +23,51 @@ function advagg_css_compress_admin_setti
   $form = array();
 
   $form[&#039;advagg_css_compress_agg_files&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Compress CSS Files&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_css_compress_agg_files&#039;, ADVAGG_CSS_COMPRESS_AGG_FILES),
+    &#039;#type&#039; =&gt; &#039;checkbox&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Compress CSS Files&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_css_compress_agg_files&#039;, ADVAGG_CSS_COMPRESS_AGG_FILES),
   );
   $form[&#039;advagg_css_compress_inline&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Compress Inline CSS&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_css_compress_inline&#039;, ADVAGG_CSS_COMPRESS_INLINE),
+    &#039;#type&#039; =&gt; &#039;checkbox&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Compress Inline CSS&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_css_compress_inline&#039;, ADVAGG_CSS_COMPRESS_INLINE),
   );
   $advagg_css_compressor = variable_get(&#039;advagg_css_compressor&#039;, ADVAGG_CSS_COMPRESSOR);
   $form[&#039;advagg_css_compressor&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;radios&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Select the compression library to use&#039;),
-    &#039;#default_value&#039;  =&gt; $advagg_css_compressor,
-    &#039;#options&#039;        =&gt; array(
+    &#039;#type&#039; =&gt; &#039;radios&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Select the compression library to use&#039;),
+    &#039;#default_value&#039; =&gt; $advagg_css_compressor,
+    &#039;#options&#039; =&gt; array(
       0 =&gt; &#039;CSSTidy&#039;,
       1 =&gt; &#039;CSS Compressor&#039;,
     ),
-    &#039;#description&#039;    =&gt; t(&#039;&lt;a href=&quot;@csscompressor&quot;&gt;CSS Compressor&lt;/a&gt; is a faster CSS compression alternative. &lt;a href=&quot;@csstidy&quot;&gt;CSSTidy&lt;/a&gt; is a well known CSS compression library, but it has some known issues/limitations.&#039;,
+    &#039;#description&#039; =&gt; t(&#039;&lt;a href=&quot;@csscompressor&quot;&gt;CSS Compressor&lt;/a&gt; is a faster CSS compression alternative. &lt;a href=&quot;@csstidy&quot;&gt;CSSTidy&lt;/a&gt; is a well known CSS compression library, but it has some known issues/limitations.&#039;,
       array(
-        &#039;@csscompressor&#039;  =&gt; &#039;http://www.codenothing.com/css-compressor/&#039;,
-        &#039;@csstidy&#039;        =&gt; &#039;https://github.com/Cerdic/CSSTidy&#039;,
-      )
+      &#039;@csscompressor&#039; =&gt; &#039;http://www.codenothing.com/css-compressor/&#039;,
+      &#039;@csstidy&#039; =&gt; &#039;https://github.com/Cerdic/CSSTidy&#039;,
+    )
     ),
   );
   if ($advagg_css_compressor == 0) {
     $form[&#039;advagg_css_compress_preserve_css&#039;] = array(
-      &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
-      &#039;#title&#039;          =&gt; t(&#039;CSSTidy: Preserve CSS&#039;),
-      &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_css_compress_preserve_css&#039;, ADVAGG_CSS_COMPRESS_PRESERVE_CSS),
-      &#039;#description&#039;    =&gt; t(&#039;If disabled CSS selectors will try to be merged together, significantly reducing the css file size. May result in broken layouts is disabled. This only applies to compression through the CSSTidy library.&#039;),
+      &#039;#type&#039; =&gt; &#039;checkbox&#039;,
+      &#039;#title&#039; =&gt; t(&#039;CSSTidy: Preserve CSS&#039;),
+      &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_css_compress_preserve_css&#039;, ADVAGG_CSS_COMPRESS_PRESERVE_CSS),
+      &#039;#description&#039; =&gt; t(&#039;If disabled CSS selectors will try to be merged together, significantly reducing the css file size. May result in broken layouts is disabled. This only applies to compression through the CSSTidy library.&#039;),
     );
   }
   else {
     $form[&#039;advagg_css_compress_compressor_level&#039;] = array(
-      &#039;#type&#039;           =&gt; &#039;radios&#039;,
-      &#039;#title&#039;          =&gt; t(&#039;CSS Compressor: Select the CSS Compression to use&#039;),
-      &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_css_compress_compressor_level&#039;, ADVAGG_CSS_COMPRESS_COMPRESSOR_LEVEL),
-      &#039;#options&#039;        =&gt; array(
-        &#039;safe&#039;  =&gt; t(&#039;Safe mode (99% safe) does zero combinations or organizing. Its the best mode if you use a lot of CSS hacks.&#039;),
-        &#039;sane&#039;  =&gt; t(&#039;Sane mode (90% safe) does most combinations (multiple long hand notations to single shorthand), but still keeps most declarations in their place.&#039;),
+      &#039;#type&#039; =&gt; &#039;radios&#039;,
+      &#039;#title&#039; =&gt; t(&#039;CSS Compressor: Select the CSS Compression to use&#039;),
+      &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_css_compress_compressor_level&#039;, ADVAGG_CSS_COMPRESS_COMPRESSOR_LEVEL),
+      &#039;#options&#039; =&gt; array(
+        &#039;safe&#039; =&gt; t(&#039;Safe mode (99% safe) does zero combinations or organizing. Its the best mode if you use a lot of CSS hacks.&#039;),
+        &#039;sane&#039; =&gt; t(&#039;Sane mode (90% safe) does most combinations (multiple long hand notations to single shorthand), but still keeps most declarations in their place.&#039;),
         &#039;small&#039; =&gt; t(&#039;Small mode (65% safe) reorganizes the whole style sheet, combines as much as it can, and will break most comment hacks.&#039;),
-        &#039;full&#039;  =&gt; t(&#039;Full mode (64% safe) does everything small does, but also converts hex codes to their short color name alternatives.&#039;),
+        &#039;full&#039; =&gt; t(&#039;Full mode (64% safe) does everything small does, but also converts hex codes to their short color name alternatives.&#039;),
       ),
-      &#039;#description&#039;    =&gt; t(&#039;This only applies to compression through the CSS Compressor library.&#039;),
+      &#039;#description&#039; =&gt; t(&#039;This only applies to compression through the CSS Compressor library.&#039;),
     );
   }
 
Only in advagg_css_compress/css-compressor-3.x: .gitignore
diff -up -r advagg_css_compress/css-compressor-3.x/src/CSSCompression.inc advagg_css_compress/css-compressor-3.x/src/CSSCompression.inc
--- advagg_css_compress/css-compressor-3.x/src/CSSCompression.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/CSSCompression.inc	2012-03-23 13:02:18.000000000 -0600
@@ -10,454 +10,429 @@ require( dirname(__FILE__) . &#039;/lib/Excep
 require( dirname(__FILE__) . &#039;/lib/Control.inc&#039; );
 
 
-Class CSSCompression
-{
-	/**
-	 * CSSCompression Info
-	 *
-	 * @const (string) VERSION: Release version
-	 * @const (string) DATE: Release date
-	 */
-	const VERSION = &quot;[VERSION]&quot;;
-	const DATE = &quot;[DATE]&quot;;
-
-	/**
-	 * WARNING: This should ALWAYS BE FALSE in production
-	 * When DEV is true, backdoor access to private methods is opened.
-	 * Only used for unit testing and development.
-	 */
-	const DEV = true;
-
-	/**
-	 * TOKEN is a special string that gets used as a marker within
-	 * the compressor, and is removed before final output. Make sure
-	 * this token is unique to your stylsheets.
-	 *
-	 * NOTE: This string gets used in regular expressions, and escaping
-	 * won&#039;t help, so don&#039;t pick a complicated token.
-	 */
-	const TOKEN = &quot;@____CSSCOMPRESSION_TOKEN____@&quot;;
-
-	/**
-	 * The default set of options for every instance.
-	 */
-	public static $defaults = array(
-		// Converts long color names to short hex names
-		// (aliceblue -&gt; #f0f8ff)
-		&#039;color-long2hex&#039; =&gt; true,
-
-		// Converts rgb colors to hex
-		// (rgb(159,80,98) -&gt; #9F5062, rgb(100%) -&gt; #FFFFFF)
-		&#039;color-rgb2hex&#039; =&gt; true,
-
-		// Converts long hex codes to short color names (#f5f5dc -&gt; beige)
-		// Only works on latest browsers, careful when using
-		&#039;color-hex2shortcolor&#039; =&gt; false,
-
-		// Converts long hex codes to short hex codes
-		// (#44ff11 -&gt; #4f1)
-		&#039;color-hex2shorthex&#039; =&gt; true,
-
-		// Converts hex codes to safe CSS Level 1 color names
-		// (#F00 -&gt; red)
-		&#039;color-hex2safe&#039; =&gt; true,
-
-		// Converts font-weight names to numbers
-		// (bold -&gt; 700)
-		&#039;fontweight2num&#039; =&gt; true,
-
-		// Removes zero decimals and 0 units
-		// (15.0px -&gt; 15px || 0px -&gt; 0)
-		&#039;format-units&#039; =&gt; true,
-
-		// Lowercases html tags from list
-		// (BODY -&gt; body)
-		&#039;lowercase-selectors&#039; =&gt; true,
-
-		// Converts id and class attribute selectors, to their short selector counterpart
-		// (div[id=blah][class=moreblah] -&gt; div#blah.moreblah)
-		&#039;attr2selector&#039; =&gt; true,
-
-		// Promotes nested id&#039;s to the front of the selector
-		// (body&gt;div#elem p -&gt; $elem p)
-		&#039;strict-id&#039; =&gt; false,
-
-		// Add space after pseudo selectors, for ie6
-		// (a:first-child{ -&gt; a:first-child {)
-		&#039;pseudo-space&#039; =&gt; false,
-
-		// Compresses single defined multi-directional properties
-		// (margin: 15px 25px 15px 25px -&gt; margin:15px 25px)
-		&#039;directional-compress&#039; =&gt; true,
-
-		// Combines multiply defined selectors and details
-		// (p{color:blue;} p{font-size:12pt} -&gt; p{color:blue;font-size:12pt;})
-		// (p{color:blue;} a{color:blue;} -&gt; p,a{color:blue;})
-		&#039;organize&#039; =&gt; true,
-
-		// Combines color/style/width properties
-		// (border-style:dashed;border-color:black;border-width:4px; -&gt; border:4px dashed black)
-		&#039;csw-combine&#039; =&gt; true,
-
-		// Combines cue/pause properties
-		// (cue-before: url(before.au); cue-after: url(after.au) -&gt; cue:url(before.au) url(after.au))
-		&#039;auralcp-combine&#039; =&gt; true,
-
-		// Combines margin/padding directionals
-		// (margin-top:10px;margin-right:5px;margin-bottom:4px;margin-left:1px; -&gt; margin:10px 5px 4px 1px;)
-		&#039;mp-combine&#039; =&gt; true,
-
-		// Combines border directionals
-		// (border-top|right|bottom|left:1px solid black -&gt; border:1px solid black)
-		&#039;border-combine&#039; =&gt; true,
-
-		// Combines font properties
-		// (font-size:12pt; font-family: arial; -&gt; font:12pt arial)
-		&#039;font-combine&#039; =&gt; true,
-
-		// Combines background properties
-		// (background-color: black; background-image: url(bgimg.jpeg); -&gt; background:black url(bgimg.jpeg))
-		&#039;background-combine&#039; =&gt; true,
-
-		// Combines list-style properties
-		// (list-style-type: round; list-style-position: outside -&gt; list-style:round outside)
-		&#039;list-combine&#039; =&gt; true,
-
-		// Combines border-radius properties
-		// {
-		//  border-top-left-radius: 10px;
-		//  border-top-right-radius: 10px;
-		//  border-bottom-right-radius: 10px;
-		//  border-bottom-left-radius: 10px;
-		// }
-		// -&gt; { border-radius: 10px; }
-		&#039;border-radius-combine&#039; =&gt; true,
-
-		// Removes the last semicolon of a property set
-		// ({margin: 2px; color: blue;} -&gt; {margin: 2px; color: blue})
-		&#039;unnecessary-semicolons&#039; =&gt; true,
-
-		// Removes multiple declarations within the same rule set
-		&#039;rm-multi-define&#039; =&gt; true,
-
-		// Adds all unknown blocks to the top of the output in a comment strip
-		// Purely for bug reporting, but also useful to know what isn&#039;t being handled
-		&#039;add-unknown&#039; =&gt; true,
-
-		// Readibility of Compressed Output, Defaults to none
-		&#039;readability&#039; =&gt; 0,
-	);
-
-	/**
-	 * Modes are predefined sets of configuration for referencing. When creating a mode, all options are set to true,
-	 * and the mode array defines which options are to be false
-	 *
-	 * @mode safe: Safe mode does zero combinations or organizing. It&#039;s the best mode if you use a lot of hacks
-	 * @mode sane: Sane mode does most combinations(multiple long hand notations to single shorthand),
-	 * --- but still keeps most declarations in their place
-	 * @mode small: Small mode reorganizes the whole sheet, combines as much as it can, and will break most comment hacks
-	 * @mode full: Full mode does everything small does, but also converts hex codes to their short color name alternatives
-	 */
-	private static $modes = array(
-		&#039;safe&#039; =&gt; array(
-			&#039;color-hex2shortcolor&#039; =&gt; false,
-			&#039;attr2selector&#039; =&gt; false,
-			&#039;strict-id&#039; =&gt; false,
-			&#039;organize&#039; =&gt; false,
-			&#039;csw-combine&#039; =&gt; false,
-			&#039;auralcp-combine&#039; =&gt; false,
-			&#039;mp-combine&#039; =&gt; false,
-			&#039;border-combine&#039; =&gt; false,
-			&#039;font-combine&#039; =&gt; false,
-			&#039;background-combine&#039; =&gt; false,
-			&#039;list-combine&#039; =&gt; false,
-			&#039;border-radius-combine&#039; =&gt; false,
-			&#039;rm-multi-define&#039; =&gt; false,
-		),
-		&#039;sane&#039; =&gt; array(
-			&#039;color-hex2shortcolor&#039; =&gt; false,
-			&#039;strict-id&#039; =&gt; false,
-			&#039;organize&#039; =&gt; false,
-			&#039;font-combine&#039; =&gt; false,
-			&#039;background-combine&#039; =&gt; false,
-			&#039;list-combine&#039; =&gt; false,
-			&#039;rm-multi-define&#039; =&gt; false,
-		),
-		&#039;small&#039; =&gt; array(
-			&#039;color-hex2shortcolor&#039; =&gt; false,
-			&#039;pseudo-space&#039; =&gt; false,
-		),
-		&#039;full&#039; =&gt; array(
-			&#039;pseudo-space&#039; =&gt; false,
-		),
-	);
-
-	/**
-	 * Readability Constants
-	 *
-	 * @param (int) READ_MAX: Maximum readability of output
-	 * @param (int) READ_MED: Medium readability of output
-	 * @param (int) READ_MIN: Minimal readability of output
-	 * @param (int) READ_NONE: No readability of output (full compression into single line)
-	 */
-	const READ_MAX = 3;
-	const READ_MED = 2;
-	const READ_MIN = 1;
-	const READ_NONE = 0;
-
-	/**
-	 * Static Helpers
-	 *
-	 * @instance express: Use a separate instance from singleton access
-	 * @instance instance: Saved instance of CSSCompression
-	 * @param (array) instances: Array of stored instances
-	 * @param (array) rjson: Comment removal before json decoding
-	 */
-	private static $express;
-	private static $instance;
-	private static $instances = array();
-	private static $rjson = array(
-		&#039;patterns&#039; =&gt; array(
-			&quot;/^(.*?){/s&quot;,
-			&quot;/(\t|\s)+\/\/.*/&quot;,
-		),
-		&#039;replacements&#039; =&gt; array(
-			&#039;{&#039;,
-			&#039;&#039;,
-		),
-	);
-
-	/**
-	 * Controller Instance
-	 */
-	private $Control;
-
-	/**
-	 * Builds the subclasses, runs the compression if css passed, and merges options
-	 *
-	 * @param (string) css: CSS to compress on initialization if needed
-	 * @param (array) options: Array of preferences to override the defaults
-	 */
-	public function __construct( $css = NULL, $options = NULL ) {
-		$this-&gt;Control = new CSSCompression_Control( $this );
-
-		// Autorun against css passed
-		if ( $css ) {
-			// Allow passing options/mode only
-			if ( is_array( $css ) || array_key_exists( $css, self::$modes ) ) {
-				$this-&gt;Control-&gt;Option-&gt;merge( $css );
-			}
-			else {
-				$this-&gt;Control-&gt;compress( $css, $options );
-			}
-		}
-		// Merge passed options
-		else if ( $options ) {
-			$this-&gt;Control-&gt;Option-&gt;merge( $options );
-		}
-	}
-
-	/**
-	 * (Proxy function) Control access to properties
-	 *
-	 *	- Getting stats/_mode/css returns the current value of that property
-	 *	- Getting options will return the current full options array
-	 *	- Getting anything else returns that current value in the options array or NULL
-	 *
-	 * @param (string) name: Name of property that you want to access
-	 */
-	public function __get( $name ) {
-		return $this-&gt;Control-&gt;get( $name );
-	}
-
-	/**
-	 * (Proxy function) The setter method only allows
-	 * access to setting values in the options array
-	 *
-	 * @param (string) name: Key name of the option you want to set
-	 * @param (mixed) value: Value of the option you want to set
-	 */
-	public function __set( $name, $value ) {
-		return $this-&gt;Control-&gt;set( $name, $value );
-	}
-
-	/**
-	 * (Proxy function) Merges a predefined set options
-	 *
-	 * @param (string) mode: Name of mode to use.
-	 */
-	public function mode( $mode = NULL ) {
-		return $this-&gt;Control-&gt;Option-&gt;merge( $mode );
-	}
-
-	/**
-	 * Creates a new mode, or overwrites existing mode
-	 *
-	 * @param (mixed) mode: Name of the mode, or array of modes
-	 * @param (array) config: Configuration of the mode
-	 */
-	public static function modes( $mode = NULL, $config = NULL ) {
-		if ( $mode === NULL ) {
-			return self::$modes;
-		}
-		else if ( is_array( $mode ) ) {
-			return array_merge( self::$modes, $mode );
-		}
-		else if ( $config === NULL ) {
-			return isset( self::$modes[ $mode ] ) ? self::$modes[ $mode ] : NULL;
-		}
-		else {
-			return self::$modes[ $mode ] = $config;
-		}
-	}
-
-	/**
-	 * (Proxy function) Maintainable access to the options array
-	 *
-	 *	- Passing no arguments returns the entire options array
-	 *	- Passing a single name argument returns the value for the option
-	 *	- Passing an array will merge the options with the array passed, for object like extension
-	 * 	- Passing both a name and value, sets the value to the name key, and returns the value
-	 *
-	 * @param (mixed) name: The key name of the option
-	 * @param (mixed) value: Value to set the option
-	 */
-	public function option( $name = NULL, $value = NULL ) {
-		return $this-&gt;Control-&gt;Option-&gt;option( $name, $value );
-	}
-
-	/**
-	 * (Proxy function) Run compression on the sheet passed.
-	 *
-	 * @param (string) css: Stylesheet to be compressed
-	 * @param (mixed) options: Array of options or mode to use.
-	 */
-	public function compress( $css = NULL, $options = NULL ) {
-		return $this-&gt;Control-&gt;compress( $css, $options );
-	}
-
-	/**
-	 * Static access for direct compression
-	 *
-	 * @param (string) css: Stylesheet to be compressed
-	 * @param (mixed) options: Array of options or mode to use.
-	 */
-	public static function express( $css = NULL, $options = NULL ) {
-		if ( ! self::$express ) {
-			self::$express = new CSSCompression();
-		}
-
-		self::$express-&gt;reset();
-		return self::$express-&gt;compress( $css, $options );
-	}
-
-	/**
-	 * (Proxy Function) Cleans out compressor and it&#039;s subclasses to defaults
-	 *
-	 * @params none
-	 */
-	public function reset(){
-		return $this-&gt;Control-&gt;reset();
-	}
-
-	/**
-	 * (Proxy Function) Cleans out class variables for next run
-	 *
-	 * @params none
-	 */
-	public function flush(){
-		return $this-&gt;Control-&gt;flush();
-	}
-
-	/**
-	 * The Singleton access method (for those that want it)
-	 *
-	 * @param (string) name: Name of the stored instance
-	 */
-	public static function getInstance( $name = NULL ) {
-		if ( $name !== NULL ) {
-			if ( ! isset( self::$instances[ $name ] ) ) {
-				self::$instances[ $name ] = new self;
-			}
-
-			return self::$instances[ $name ];
-		}
-		else if ( ! self::$instance ) {
-			self::$instance = new self;
-		}
-
-		return self::$instance;
-	}
-
-	/**
-	 * Reads JOSN based files, strips comments and converts to array
-	 *
-	 * @param (string) file: Filename
-	 */
-	public static function getJSON( $file ) {
-		// Assume helper file if full path not given
-		$file = $file[ 0 ] == &#039;/&#039; ? $file : dirname(__FILE__) . &#039;/helpers/&#039; . $file;
-
-		// Strip comments
-		$json = preg_replace( self::$rjson[&#039;patterns&#039;], self::$rjson[&#039;replacements&#039;], file_get_contents( $file ) );
-
-		// Decode json
-		$json = json_decode( $json, true );
-
-		// Check for errors
-		if ( $json === NULL ) {
-			$e = &#039;&#039;;
-			// JSON Errors, taken directly from http://php.net/manual/en/function.json-last-error.php
-			switch( json_last_error() ) {
-				case JSON_ERROR_NONE:
-					$e = &#039;No error has occurred&#039;;
-					break;
-				case JSON_ERROR_DEPTH:
-					$e = &#039;The maximum stack depth has been exceeded&#039;;
-					break;
-				case JSON_ERROR_CTRL_CHAR:
-					$e = &#039;Control character error, possibly incorrectly encoded&#039;;
-					break;
-				case JSON_ERROR_STATE_MISMATCH:
-					$e = &#039;Invalid or malformed JSON&#039;;
-					break;
-				case JSON_ERROR_SYNTAX:
-					$e = &#039;Syntax error&#039;;
-					break;
-				case JSON_ERROR_UTF8:
-					$e = &#039;Malformed UTF-8 characters, possibly incorrectly encoded&#039;;
-					break;
-				default:
-					$e = &#039;Unknown JSON Error&#039;;
-					break;
-			}
-
-			throw new CSSCompression_Exception( &quot;JSON Error in $file: $e&quot; );
-		}
-
-		// Good to go
-		return $json;
-	}
-
-	/**
-	 * Backdoor access to subclasses
-	 * ONLY FOR DEVELOPMENT/TESTING.
-	 *
-	 * @param (string) class: Name of the focus class
-	 * @param (string) method: Method function to call
-	 * @param (array) args: Array of arguments to pass in
-	 */
-	public function access( $class = NULL, $method = NULL, $args = NULL ) {
-		if ( ! self::DEV ) {
-			throw new CSSCompression_Exception( &quot;CSSCompression is not in development mode.&quot; );
-		}
-		else if ( $class === NULL || $method === NULL || $args === NULL ) {
-			throw new CSSCompression_Exception( &quot;Invalid Access Call.&quot; );
-		}
-		else if ( ! is_array( $args ) ) {
-			throw new CSSCompression_Exception( &quot;Expecting array of arguments.&quot; );
-		}
-
-		return $this-&gt;Control-&gt;access( $class, $method, $args );
-	}
-};
+class CSSCompression {
+  /**
+   * CSSCompression Info
+   *
+   * @const (string) VERSION: Release version
+   * @const (string) DATE: Release date
+   */
+  const VERSION = &quot;[VERSION]&quot;;
+  const DATE = &quot;[DATE]&quot;;
+
+  /**
+   * WARNING: This should ALWAYS BE FALSE in production
+   * When DEV is true, backdoor access to private methods is opened.
+   * Only used for unit testing and development.
+   */
+  const DEV = true;
+
+  /**
+   * TOKEN is a special string that gets used as a marker within
+   * the compressor, and is removed before final output. Make sure
+   * this token is unique to your stylsheets.
+   *
+   * NOTE: This string gets used in regular expressions, and escaping
+   * won&#039;t help, so don&#039;t pick a complicated token.
+   */
+  const TOKEN = &quot;@____CSSCOMPRESSION_TOKEN____@&quot;;
+
+  /**
+   * The default set of options for every instance.
+   */
+  public static $defaults = array(
+    // Converts long color names to short hex names
+    // (aliceblue -&gt; #f0f8ff)
+    &#039;color-long2hex&#039; =&gt; true,
+    // Converts rgb colors to hex
+    // (rgb(159,80,98) -&gt; #9F5062, rgb(100%) -&gt; #FFFFFF)
+    &#039;color-rgb2hex&#039; =&gt; true,
+    // Converts long hex codes to short color names (#f5f5dc -&gt; beige)
+    // Only works on latest browsers, careful when using
+    &#039;color-hex2shortcolor&#039; =&gt; false,
+    // Converts long hex codes to short hex codes
+    // (#44ff11 -&gt; #4f1)
+    &#039;color-hex2shorthex&#039; =&gt; true,
+    // Converts hex codes to safe CSS Level 1 color names
+    // (#F00 -&gt; red)
+    &#039;color-hex2safe&#039; =&gt; true,
+    // Converts font-weight names to numbers
+    // (bold -&gt; 700)
+    &#039;fontweight2num&#039; =&gt; true,
+    // Removes zero decimals and 0 units
+    // (15.0px -&gt; 15px || 0px -&gt; 0)
+    &#039;format-units&#039; =&gt; true,
+    // Lowercases html tags from list
+    // (BODY -&gt; body)
+    &#039;lowercase-selectors&#039; =&gt; true,
+    // Converts id and class attribute selectors, to their short selector counterpart
+    // (div[id=blah][class=moreblah] -&gt; div#blah.moreblah)
+    &#039;attr2selector&#039; =&gt; true,
+    // Promotes nested id&#039;s to the front of the selector
+    // (body&gt;div#elem p -&gt; $elem p)
+    &#039;strict-id&#039; =&gt; false,
+    // Add space after pseudo selectors, for ie6
+    // (a:first-child{ -&gt; a:first-child {)
+    &#039;pseudo-space&#039; =&gt; false,
+    // Compresses single defined multi-directional properties
+    // (margin: 15px 25px 15px 25px -&gt; margin:15px 25px)
+    &#039;directional-compress&#039; =&gt; true,
+    // Combines multiply defined selectors and details
+    // (p{color:blue;} p{font-size:12pt} -&gt; p{color:blue;font-size:12pt;})
+    // (p{color:blue;} a{color:blue;} -&gt; p,a{color:blue;})
+    &#039;organize&#039; =&gt; true,
+    // Combines color/style/width properties
+    // (border-style:dashed;border-color:black;border-width:4px; -&gt; border:4px dashed black)
+    &#039;csw-combine&#039; =&gt; true,
+    // Combines cue/pause properties
+    // (cue-before: url(before.au); cue-after: url(after.au) -&gt; cue:url(before.au) url(after.au))
+    &#039;auralcp-combine&#039; =&gt; true,
+    // Combines margin/padding directionals
+    // (margin-top:10px;margin-right:5px;margin-bottom:4px;margin-left:1px; -&gt; margin:10px 5px 4px 1px;)
+    &#039;mp-combine&#039; =&gt; true,
+    // Combines border directionals
+    // (border-top|right|bottom|left:1px solid black -&gt; border:1px solid black)
+    &#039;border-combine&#039; =&gt; true,
+    // Combines font properties
+    // (font-size:12pt; font-family: arial; -&gt; font:12pt arial)
+    &#039;font-combine&#039; =&gt; true,
+    // Combines background properties
+    // (background-color: black; background-image: url(bgimg.jpeg); -&gt; background:black url(bgimg.jpeg))
+    &#039;background-combine&#039; =&gt; true,
+    // Combines list-style properties
+    // (list-style-type: round; list-style-position: outside -&gt; list-style:round outside)
+    &#039;list-combine&#039; =&gt; true,
+    // Combines border-radius properties
+    // {
+    //  border-top-left-radius: 10px;
+    //  border-top-right-radius: 10px;
+    //  border-bottom-right-radius: 10px;
+    //  border-bottom-left-radius: 10px;
+    // }
+    // -&gt; { border-radius: 10px; }
+    &#039;border-radius-combine&#039; =&gt; true,
+    // Removes the last semicolon of a property set
+    // ({margin: 2px; color: blue;} -&gt; {margin: 2px; color: blue})
+    &#039;unnecessary-semicolons&#039; =&gt; true,
+    // Removes multiple declarations within the same rule set
+    &#039;rm-multi-define&#039; =&gt; true,
+    // Adds all unknown blocks to the top of the output in a comment strip
+    // Purely for bug reporting, but also useful to know what isn&#039;t being handled
+    &#039;add-unknown&#039; =&gt; true,
+    // Readibility of Compressed Output, Defaults to none
+    &#039;readability&#039; =&gt; 0,
+  );
+
+  /**
+   * Modes are predefined sets of configuration for referencing. When creating a mode, all options are set to true,
+   * and the mode array defines which options are to be false
+   *
+   * @mode safe: Safe mode does zero combinations or organizing. It&#039;s the best mode if you use a lot of hacks
+   * @mode sane: Sane mode does most combinations(multiple long hand notations to single shorthand),
+   * --- but still keeps most declarations in their place
+   * @mode small: Small mode reorganizes the whole sheet, combines as much as it can, and will break most comment hacks
+   * @mode full: Full mode does everything small does, but also converts hex codes to their short color name alternatives
+   */
+  private static $modes = array(
+    &#039;safe&#039; =&gt; array(
+      &#039;color-hex2shortcolor&#039; =&gt; false,
+      &#039;attr2selector&#039; =&gt; false,
+      &#039;strict-id&#039; =&gt; false,
+      &#039;organize&#039; =&gt; false,
+      &#039;csw-combine&#039; =&gt; false,
+      &#039;auralcp-combine&#039; =&gt; false,
+      &#039;mp-combine&#039; =&gt; false,
+      &#039;border-combine&#039; =&gt; false,
+      &#039;font-combine&#039; =&gt; false,
+      &#039;background-combine&#039; =&gt; false,
+      &#039;list-combine&#039; =&gt; false,
+      &#039;border-radius-combine&#039; =&gt; false,
+      &#039;rm-multi-define&#039; =&gt; false,
+    ),
+    &#039;sane&#039; =&gt; array(
+      &#039;color-hex2shortcolor&#039; =&gt; false,
+      &#039;strict-id&#039; =&gt; false,
+      &#039;organize&#039; =&gt; false,
+      &#039;font-combine&#039; =&gt; false,
+      &#039;background-combine&#039; =&gt; false,
+      &#039;list-combine&#039; =&gt; false,
+      &#039;rm-multi-define&#039; =&gt; false,
+    ),
+    &#039;small&#039; =&gt; array(
+      &#039;color-hex2shortcolor&#039; =&gt; false,
+      &#039;pseudo-space&#039; =&gt; false,
+    ),
+    &#039;full&#039; =&gt; array(
+      &#039;pseudo-space&#039; =&gt; false,
+    ),
+  );
+
+  /**
+   * Readability Constants
+   *
+   * @param (int) READ_MAX: Maximum readability of output
+   * @param (int) READ_MED: Medium readability of output
+   * @param (int) READ_MIN: Minimal readability of output
+   * @param (int) READ_NONE: No readability of output (full compression into single line)
+   */
+  const READ_MAX = 3;
+  const READ_MED = 2;
+  const READ_MIN = 1;
+  const READ_NONE = 0;
+
+  /**
+   * Static Helpers
+   *
+   * @instance express: Use a separate instance from singleton access
+   * @instance instance: Saved instance of CSSCompression
+   * @param (array) instances: Array of stored instances
+   * @param (array) rjson: Comment removal before json decoding
+   */
+  private static $express;
+  private static $instance;
+  private static $instances = array();
+  private static $rjson = array(
+    &#039;patterns&#039; =&gt; array(
+      &quot;/^(.*?){/s&quot;,
+      &quot;/(\t|\s)+\/\/.*/&quot;,
+    ),
+    &#039;replacements&#039; =&gt; array(
+      &#039;{&#039;,
+      &#039;&#039;,
+    ),
+  );
+
+  /**
+   * Controller Instance
+   */
+  private $Control;
+
+  /**
+   * Builds the subclasses, runs the compression if css passed, and merges options
+   *
+   * @param (string) css: CSS to compress on initialization if needed
+   * @param (array) options: Array of preferences to override the defaults
+   */
+  public function __construct( $css = NULL, $options = NULL ) {
+    $this-&gt;Control = new CSSCompression_Control( $this );
+
+    // Autorun against css passed
+    if ( $css ) {
+      // Allow passing options/mode only
+      if ( is_array( $css ) || array_key_exists( $css, self::$modes ) ) {
+        $this-&gt;Control-&gt;Option-&gt;merge( $css );
+      }
+      else {
+        $this-&gt;Control-&gt;compress( $css, $options );
+      }
+    }
+    // Merge passed options
+    else if ( $options ) {
+      $this-&gt;Control-&gt;Option-&gt;merge( $options );
+    }
+  }
+
+  /**
+   * (Proxy function) Control access to properties
+   *
+   *	- Getting stats/_mode/css returns the current value of that property
+   *	- Getting options will return the current full options array
+   *	- Getting anything else returns that current value in the options array or NULL
+   *
+   * @param (string) name: Name of property that you want to access
+   */
+  public function __get( $name ) {
+    return $this-&gt;Control-&gt;get( $name );
+  }
+
+  /**
+   * (Proxy function) The setter method only allows
+   * access to setting values in the options array
+   *
+   * @param (string) name: Key name of the option you want to set
+   * @param (mixed) value: Value of the option you want to set
+   */
+  public function __set( $name, $value ) {
+    return $this-&gt;Control-&gt;set( $name, $value );
+  }
+
+  /**
+   * (Proxy function) Merges a predefined set options
+   *
+   * @param (string) mode: Name of mode to use.
+   */
+  public function mode( $mode = NULL ) {
+    return $this-&gt;Control-&gt;Option-&gt;merge( $mode );
+  }
+
+  /**
+   * Creates a new mode, or overwrites existing mode
+   *
+   * @param (mixed) mode: Name of the mode, or array of modes
+   * @param (array) config: Configuration of the mode
+   */
+  public static function modes( $mode = NULL, $config = NULL ) {
+    if ( $mode === NULL ) {
+      return self::$modes;
+    }
+    else if ( is_array( $mode ) ) {
+      return array_merge( self::$modes, $mode );
+    }
+    else if ( $config === NULL ) {
+      return isset( self::$modes[$mode] ) ? self::$modes[$mode] : NULL;
+    }
+    else {
+      return self::$modes[$mode] = $config;
+    }
+  }
+
+  /**
+   * (Proxy function) Maintainable access to the options array
+   *
+   *	- Passing no arguments returns the entire options array
+   *	- Passing a single name argument returns the value for the option
+   *	- Passing an array will merge the options with the array passed, for object like extension
+   * 	- Passing both a name and value, sets the value to the name key, and returns the value
+   *
+   * @param (mixed) name: The key name of the option
+   * @param (mixed) value: Value to set the option
+   */
+  public function option( $name = NULL, $value = NULL ) {
+    return $this-&gt;Control-&gt;Option-&gt;option( $name, $value );
+  }
+
+  /**
+   * (Proxy function) Run compression on the sheet passed.
+   *
+   * @param (string) css: Stylesheet to be compressed
+   * @param (mixed) options: Array of options or mode to use.
+   */
+  public function compress( $css = NULL, $options = NULL ) {
+    return $this-&gt;Control-&gt;compress( $css, $options );
+  }
+
+  /**
+   * Static access for direct compression
+   *
+   * @param (string) css: Stylesheet to be compressed
+   * @param (mixed) options: Array of options or mode to use.
+   */
+  public static function express( $css = NULL, $options = NULL ) {
+    if ( ! self::$express ) {
+      self::$express = new CSSCompression();
+    }
+
+    self::$express-&gt;reset();
+    return self::$express-&gt;compress( $css, $options );
+  }
+
+  /**
+   * (Proxy Function) Cleans out compressor and it&#039;s subclasses to defaults
+   *
+   * @params none
+   */
+  public function reset() {
+    return $this-&gt;Control-&gt;reset();
+  }
+
+  /**
+   * (Proxy Function) Cleans out class variables for next run
+   *
+   * @params none
+   */
+  public function flush() {
+    return $this-&gt;Control-&gt;flush();
+  }
+
+  /**
+   * The Singleton access method (for those that want it)
+   *
+   * @param (string) name: Name of the stored instance
+   */
+  public static function getInstance( $name = NULL ) {
+    if ( $name !== NULL ) {
+      if ( ! isset( self::$instances[$name] ) ) {
+        self::$instances[$name] = new self;
+      }
+
+      return self::$instances[$name];
+    }
+    else if ( ! self::$instance ) {
+      self::$instance = new self;
+    }
+
+    return self::$instance;
+  }
+
+  /**
+   * Reads JOSN based files, strips comments and converts to array
+   *
+   * @param (string) file: Filename
+   */
+  public static function getJSON( $file ) {
+    // Assume helper file if full path not given
+    $file = $file[0] == &#039;/&#039; ? $file : dirname(__FILE__) . &#039;/helpers/&#039; . $file;
+
+    // Strip comments
+    $json = preg_replace( self::$rjson[&#039;patterns&#039;], self::$rjson[&#039;replacements&#039;], file_get_contents( $file ) );
+
+    // Decode json
+    $json = json_decode( $json, true );
+
+    // Check for errors
+    if ( $json === NULL ) {
+      $e = &#039;&#039;;
+      // JSON Errors, taken directly from http://php.net/manual/en/function.json-last-error.php
+      switch ( json_last_error() ) {
+        case JSON_ERROR_NONE:
+          $e = &#039;No error has occurred&#039;;
+          break;
+        case JSON_ERROR_DEPTH:
+          $e = &#039;The maximum stack depth has been exceeded&#039;;
+          break;
+        case JSON_ERROR_CTRL_CHAR:
+          $e = &#039;Control character error, possibly incorrectly encoded&#039;;
+          break;
+        case JSON_ERROR_STATE_MISMATCH:
+          $e = &#039;Invalid or malformed JSON&#039;;
+          break;
+        case JSON_ERROR_SYNTAX:
+          $e = &#039;Syntax error&#039;;
+          break;
+        case JSON_ERROR_UTF8:
+          $e = &#039;Malformed UTF-8 characters, possibly incorrectly encoded&#039;;
+          break;
+        default:
+          $e = &#039;Unknown JSON Error&#039;;
+          break;
+      }
+
+      throw new CSSCompression_Exception( &quot;JSON Error in $file: $e&quot; );
+    }
+
+    // Good to go
+    return $json;
+  }
+
+  /**
+   * Backdoor access to subclasses
+   * ONLY FOR DEVELOPMENT/TESTING.
+   *
+   * @param (string) class: Name of the focus class
+   * @param (string) method: Method function to call
+   * @param (array) args: Array of arguments to pass in
+   */
+  public function access( $class = NULL, $method = NULL, $args = NULL ) {
+    if ( ! self::DEV ) {
+      throw new CSSCompression_Exception( &quot;CSSCompression is not in development mode.&quot; );
+    }
+    else if ( $class === NULL || $method === NULL || $args === NULL ) {
+      throw new CSSCompression_Exception( &quot;Invalid Access Call.&quot; );
+    }
+    else if ( ! is_array( $args ) ) {
+      throw new CSSCompression_Exception( &quot;Expecting array of arguments.&quot; );
+    }
+
+    return $this-&gt;Control-&gt;access( $class, $method, $args );
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Cleanup.inc advagg_css_compress/css-compressor-3.x/src/lib/Cleanup.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Cleanup.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Cleanup.inc	2012-03-23 13:02:18.000000000 -0600
@@ -5,215 +5,214 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Cleanup
-{
+class CSSCompression_Cleanup {
 
-	/**
-	 * Cleanup patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @param (string) token: Copy of the injection token
-	 * @param (regex) rtoken: Token regex built upon instantiation
-	 * @param (array) options: Reference to options
-	 * @param (regex) rsemi: Checks for last semit colon in details
-	 * @param (regex) rsemicolon: Checks for semicolon without an escape &#039;\&#039; character before it
-	 * @param (regex) rspace: Checks for space without an escape &#039;\&#039; character before it
-	 * @param (regex) rcolon: Checks for colon without an escape &#039;\&#039; character before it
-	 * @param (regex) rquote: Checks for quote (&#039;) without an escape &#039;\&#039; character before it
-	 * @param (array) rescape: Array of patterns for groupings that should be escaped
-	 * @param (array) escaped: Contains patterns and replacements for espaced characters
-	 */
-	private $Control;
-	private $token = &#039;&#039;;
-	private $rtoken = &#039;&#039;;
-	private $options = array();
-	private $rsemi = &quot;/;$/&quot;;
-	private $rsemicolon = &quot;/(?&lt;!\\\);/&quot;;
-	private $rspace = &quot;/(?&lt;!\\\)\s/&quot;;
-	private $rcolon = &quot;/(?&lt;!\\\):/&quot;;
-	private $rquote = &quot;/(?&lt;!\\\)&#039;/&quot;;
-	private $rescape = array(
-		&quot;/((?&lt;!\\\)\&quot;)(.*?)((?&lt;!\\\)\&quot;)/&quot;,
-		&quot;/((?&lt;!\\\)&#039;)(.*?)((?&lt;!\\\)&#039;)/&quot;,
-		&quot;/(url\()(.*?)(\))/&quot;,
-	);
-	private $escaped = array(
-		&#039;search&#039; =&gt; array(
-			&quot;\\:&quot;,
-			&quot;\\;&quot;,
-			&quot;\\}&quot;,
-			&quot;\\{&quot;,
-			&quot;\\@&quot;,
-			&quot;\\!&quot;,
-			&quot;\\,&quot;,
-			&quot;\\&gt;&quot;,
-			&quot;\\+&quot;,
-			&quot;\\~&quot;,
-			&quot;\\/&quot;,
-			&quot;\\*&quot;,
-			&quot;\\.&quot;,
-			&quot;\\=&quot;,
-			&quot;\\#&quot;,
-			&quot;\\r&quot;,
-			&quot;\\n&quot;,
-			&quot;\\t&quot;,
-			&quot;\\ &quot;,
-		),
-		&#039;replace&#039; =&gt; array(
-			&quot;:&quot;,
-			&quot;;&quot;,
-			&quot;}&quot;,
-			&quot;{&quot;,
-			&quot;@&quot;,
-			&quot;!&quot;,
-			&quot;,&quot;,
-			&quot;&gt;&quot;,
-			&quot;+&quot;,
-			&quot;~&quot;,
-			&quot;/&quot;,
-			&quot;*&quot;,
-			&quot;.&quot;,
-			&quot;=&quot;,
-			&quot;#&quot;,
-			&quot;\r&quot;,
-			&quot;\n&quot;,
-			&quot;\t&quot;,
-			&quot; &quot;,
-		),
-	);
-
-	/**
-	 * Build the token regex based on defined token
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 */
-	public function __construct( CSSCompression_Control $control ) {
-		$this-&gt;Control = $control;
-		$this-&gt;token = CSSCompression::TOKEN;
-		$this-&gt;options = &amp;$control-&gt;Option-&gt;options;
-
-		// Have to build the token regexs after initialization
-		$this-&gt;rtoken = &quot;/($this-&gt;token)(.*?)($this-&gt;token)/&quot;;
-		array_push( $this-&gt;rescape, $this-&gt;rtoken );
-	}
-
-	/**
-	 * Central cleanup process, removes all injections
-	 *
-	 * @param (array) selectors: Array of selectors
-	 * @param (array) details: Array of details
-	 */
-	public function cleanup( &amp;$selectors, &amp;$details ) {
-		foreach ( $details as $i =&gt; &amp;$value ) {
-			// Auto skip sections
-			if ( isset( $selectors[ $i ] ) &amp;&amp; strpos( $selectors[ $i ], $this-&gt;token ) === 0 ) {
-				continue;
-			}
-
-			// Removing dupes
-			if ( $this-&gt;options[&#039;rm-multi-define&#039;] ) {
-				$value = $this-&gt;removeMultipleDefinitions( $value );
-			}
-
-			$value = $this-&gt;removeUnnecessarySemicolon( $value );
-		}
-
-		return array( $selectors, $details );
-	}
-
-	/**
-	 * Removes &#039;\&#039; from possible splitter characters in URLs
-	 *
-	 * @param (string) css: Full css sheet
-	 */
-	public function removeInjections( $css ) {
-		// Remove escaped characters
-		foreach ( $this-&gt;rescape as $regex ) {
-			$pos = 0;
-			while ( preg_match( $regex, $css, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-				$value = $match[ 1 ][ 0 ]
-					. str_replace( $this-&gt;escaped[&#039;search&#039;], $this-&gt;escaped[&#039;replace&#039;], $match[ 2 ][ 0 ] )
-					. $match[ 3 ][ 0 ];
-				$css = substr_replace( $css, $value, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
-				$pos = $match[ 0 ][ 1 ] + strlen( $value ) + 1;
-			}
-		}
-
-		// Remove token injections
-		$pos = 0;
-		while ( preg_match( $this-&gt;rtoken, $css, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			$value = $match[ 2 ][ 0 ];
-			$id = substr( $css, $match[ 0 ][ 1 ] - 4, 4 ) == &#039;[id=&#039; ? true : false;
-			$class = substr( $css, $match[ 0 ][ 1 ] - 7, 7 ) == &#039;[class=&#039; ? true : false;
-
-			if ( preg_match( $this-&gt;rspace, $value ) || ( ! $id &amp;&amp; ! $class ) ) {
-				$quote = preg_match( $this-&gt;rquote, $value ) ? &quot;\&quot;&quot; : &quot;&#039;&quot;;
-				$value = &quot;$quote$value$quote&quot;;
-				$css = substr_replace( $css, $value, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
-				$pos = $match[ 0 ][ 1 ] + strlen( $value ) + 1;
-			}
-			else {
-				$css = substr_replace( $css, $value, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
-				$pos = $match[ 0 ][ 1 ] + strlen( $value ) + 1;
-			}
-		}
-
-		return $css;
-	}
-
-	/**
-	 * Removes multiple definitions that were created during compression
-	 *
-	 * @param (string) val: CSS Selector Properties
-	 */
-	private function removeMultipleDefinitions( $val = &#039;&#039; ) {
-		$storage = array();
-		$arr = preg_split( $this-&gt;rsemicolon, $val );
-
-		foreach ( $arr as $x ) {
-			if ( $x ) {
-				list( $a, $b ) = preg_split( $this-&gt;rcolon, $x, 2 );
-				$storage[ $a ] = $b;
-			}
-		}
-
-		if ( $storage ) {
-			$val = &#039;&#039;;
-			foreach ( $storage as $x =&gt; $y ) {
-				$val .= &quot;$x:$y;&quot;;
-			}
-		}
-
-		// Return converted val
-		return $val;
-	}
-
-	/**
-	 * Removes last semicolons on the final property of a set
-	 *
-	 * @param (string) value: rule set
-	 */
-	private function removeUnnecessarySemicolon( $value ) {
-		return preg_replace( $this-&gt;rsemi, &#039;&#039;, $value );
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			if ( $method == &#039;cleanup&#039; ) {
-				return $this-&gt;cleanup( $args[ 0 ], $args[ 1 ] );
-			}
-			else {
-				return call_user_func_array( array( $this, $method ), $args );
-			}
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Cleanup Class - &quot; . $method );
-		}
-	}
-};
+  /**
+   * Cleanup patterns
+   *
+   * @class Control: Compression Controller
+   * @param (string) token: Copy of the injection token
+   * @param (regex) rtoken: Token regex built upon instantiation
+   * @param (array) options: Reference to options
+   * @param (regex) rsemi: Checks for last semit colon in details
+   * @param (regex) rsemicolon: Checks for semicolon without an escape &#039;\&#039; character before it
+   * @param (regex) rspace: Checks for space without an escape &#039;\&#039; character before it
+   * @param (regex) rcolon: Checks for colon without an escape &#039;\&#039; character before it
+   * @param (regex) rquote: Checks for quote (&#039;) without an escape &#039;\&#039; character before it
+   * @param (array) rescape: Array of patterns for groupings that should be escaped
+   * @param (array) escaped: Contains patterns and replacements for espaced characters
+   */
+  private $Control;
+  private $token = &#039;&#039;;
+  private $rtoken = &#039;&#039;;
+  private $options = array();
+  private $rsemi = &quot;/;$/&quot;;
+  private $rsemicolon = &quot;/(?&lt;!\\\);/&quot;;
+  private $rspace = &quot;/(?&lt;!\\\)\s/&quot;;
+  private $rcolon = &quot;/(?&lt;!\\\):/&quot;;
+  private $rquote = &quot;/(?&lt;!\\\)&#039;/&quot;;
+  private $rescape = array(
+    &quot;/((?&lt;!\\\)\&quot;)(.*?)((?&lt;!\\\)\&quot;)/&quot;,
+    &quot;/((?&lt;!\\\)&#039;)(.*?)((?&lt;!\\\)&#039;)/&quot;,
+    &quot;/(url\()(.*?)(\))/&quot;,
+  );
+  private $escaped = array(
+    &#039;search&#039; =&gt; array(
+      &quot;\\:&quot;,
+      &quot;\\;&quot;,
+      &quot;\\}&quot;,
+      &quot;\\{&quot;,
+      &quot;\\@&quot;,
+      &quot;\\!&quot;,
+      &quot;\\,&quot;,
+      &quot;\\&gt;&quot;,
+      &quot;\\+&quot;,
+      &quot;\\~&quot;,
+      &quot;\\/&quot;,
+      &quot;\\*&quot;,
+      &quot;\\.&quot;,
+      &quot;\\=&quot;,
+      &quot;\\#&quot;,
+      &quot;\\r&quot;,
+      &quot;\\n&quot;,
+      &quot;\\t&quot;,
+      &quot;\\ &quot;,
+    ),
+    &#039;replace&#039; =&gt; array(
+      &quot;:&quot;,
+      &quot;;&quot;,
+      &quot;}&quot;,
+      &quot;{&quot;,
+      &quot;@&quot;,
+      &quot;!&quot;,
+      &quot;,&quot;,
+      &quot;&gt;&quot;,
+      &quot;+&quot;,
+      &quot;~&quot;,
+      &quot;/&quot;,
+      &quot;*&quot;,
+      &quot;.&quot;,
+      &quot;=&quot;,
+      &quot;#&quot;,
+      &quot;\r&quot;,
+      &quot;\n&quot;,
+      &quot;\t&quot;,
+      &quot; &quot;,
+    ),
+  );
+
+  /**
+   * Build the token regex based on defined token
+   *
+   * @param (class) control: CSSCompression Controller
+   */
+  public function __construct( CSSCompression_Control $control ) {
+    $this-&gt;Control = $control;
+    $this-&gt;token = CSSCompression::TOKEN;
+    $this-&gt;options = &amp;$control-&gt;Option-&gt;options;
+
+    // Have to build the token regexs after initialization
+    $this-&gt;rtoken = &quot;/($this-&gt;token)(.*?)($this-&gt;token)/&quot;;
+    array_push( $this-&gt;rescape, $this-&gt;rtoken );
+  }
+
+  /**
+   * Central cleanup process, removes all injections
+   *
+   * @param (array) selectors: Array of selectors
+   * @param (array) details: Array of details
+   */
+  public function cleanup( &amp;$selectors, &amp;$details ) {
+    foreach ( $details as $i =&gt; &amp;$value ) {
+      // Auto skip sections
+      if ( isset( $selectors[$i] ) &amp;&amp; strpos( $selectors[$i], $this-&gt;token ) === 0 ) {
+        continue;
+      }
+
+      // Removing dupes
+      if ( $this-&gt;options[&#039;rm-multi-define&#039;] ) {
+        $value = $this-&gt;removeMultipleDefinitions( $value );
+      }
+
+      $value = $this-&gt;removeUnnecessarySemicolon( $value );
+    }
+
+    return array($selectors, $details);
+  }
+
+  /**
+   * Removes &#039;\&#039; from possible splitter characters in URLs
+   *
+   * @param (string) css: Full css sheet
+   */
+  public function removeInjections( $css ) {
+    // Remove escaped characters
+    foreach ( $this-&gt;rescape as $regex ) {
+      $pos = 0;
+      while ( preg_match( $regex, $css, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+        $value = $match[1][0]
+					. str_replace( $this-&gt;escaped[&#039;search&#039;], $this-&gt;escaped[&#039;replace&#039;], $match[2][0] )
+					. $match[3][0];
+        $css = substr_replace( $css, $value, $match[0][1], strlen( $match[0][0] ) );
+        $pos = $match[0][1] + strlen( $value ) + 1;
+      }
+    }
+
+    // Remove token injections
+    $pos = 0;
+    while ( preg_match( $this-&gt;rtoken, $css, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      $value = $match[2][0];
+      $id = substr( $css, $match[0][1] - 4, 4 ) == &#039;[id=&#039; ? true : false;
+      $class = substr( $css, $match[0][1] - 7, 7 ) == &#039;[class=&#039; ? true : false;
+
+      if ( preg_match( $this-&gt;rspace, $value ) || ( ! $id &amp;&amp; ! $class ) ) {
+        $quote = preg_match( $this-&gt;rquote, $value ) ? &quot;\&quot;&quot; : &quot;&#039;&quot;;
+        $value = &quot;$quote$value$quote&quot;;
+        $css = substr_replace( $css, $value, $match[0][1], strlen( $match[0][0] ) );
+        $pos = $match[0][1] + strlen( $value ) + 1;
+      }
+      else {
+        $css = substr_replace( $css, $value, $match[0][1], strlen( $match[0][0] ) );
+        $pos = $match[0][1] + strlen( $value ) + 1;
+      }
+    }
+
+    return $css;
+  }
+
+  /**
+   * Removes multiple definitions that were created during compression
+   *
+   * @param (string) val: CSS Selector Properties
+   */
+  private function removeMultipleDefinitions( $val = &#039;&#039; ) {
+    $storage = array();
+    $arr = preg_split( $this-&gt;rsemicolon, $val );
+
+    foreach ( $arr as $x ) {
+      if ( $x ) {
+        list( $a, $b ) = preg_split( $this-&gt;rcolon, $x, 2 );
+        $storage[$a] = $b;
+      }
+    }
+
+    if ( $storage ) {
+      $val = &#039;&#039;;
+      foreach ( $storage as $x =&gt; $y ) {
+        $val .= &quot;$x:$y;&quot;;
+      }
+    }
+
+    // Return converted val
+    return $val;
+  }
+
+  /**
+   * Removes last semicolons on the final property of a set
+   *
+   * @param (string) value: rule set
+   */
+  private function removeUnnecessarySemicolon( $value ) {
+    return preg_replace( $this-&gt;rsemi, &#039;&#039;, $value );
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      if ( $method == &#039;cleanup&#039; ) {
+        return $this-&gt;cleanup( $args[0], $args[1] );
+      }
+      else {
+        return call_user_func_array( array($this, $method), $args );
+      }
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Cleanup Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Color.inc advagg_css_compress/css-compressor-3.x/src/lib/Color.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Color.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Color.inc	2012-03-23 13:02:18.000000000 -0600
@@ -5,193 +5,192 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Color
-{
-	/**
-	 * Color Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @param (array) options: Reference to options array
-	 * @param (regex) rrgb: Checks for rgb notation
-	 * @param (regex) rhex: Checks for hex code
-	 * @param (regex) rfullhex: Checks for full 6 character hex code
-	 * @static (array) color2hex: Long color name to hex code conversions
-	 * @static (array) hex2short: Hex code to short color name conversions
-	 * @static (array) hex2short_safe: CSS Level 1 safe color names that are shorter than hex codes
-	 * @static (array) files: List of static helpers with their class vars
-	 */
-	private $Control;
-	private $options = array();
-	private $rrgb = &quot;/^rgb\((\d{1,3}\%?(,\d{1,3}\%?,\d{1,3}\%?)?)\)$/i&quot;;
-	private $rhex = &quot;/^#([0-9a-f]{3}|[0-9a-f]{6})$/i&quot;;
-	private $rfullhex = &quot;/^#([0-9a-f]{6})$/i&quot;;
-	private static $color2hex = array();
-	private static $hex2short = array();
-	private static $hex2short_safe = array();
-	private static $files = array(
-		&#039;color2hex&#039; =&gt; &#039;long2hex-colors.json&#039;,
-		&#039;hex2short&#039; =&gt; &#039;hex2short-colors.json&#039;,
-		&#039;hex2short_safe&#039; =&gt; &#039;hex2short-safe.json&#039;,
-	);
-
-	/**
-	 * Stash a reference to the controller on each instantiation
-	 * and install conversion helpers
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 */
-	public function __construct( CSSCompression_Control $control ) {
-		$this-&gt;Control = $control;
-		$this-&gt;options = &amp;$control-&gt;Option-&gt;options;
-
-		if ( ! self::$color2hex ) {
-			foreach ( self::$files as $v =&gt; $file ) {
-				self::$$v = CSSCompression::getJSON( $file );
-			}
-		}
-	}
-
-	/**
-	 * Central handler for all color conversions.
-	 *
-	 * @param (string) val: Color to be parsed
-	 */
-	public function color( $val ) {
-		// Converts rgb values to hex codes
-		if ( $this-&gt;options[&#039;color-rgb2hex&#039;] ) {
-			$val = $this-&gt;rgb2hex( $val );
-		}
-
-		// Convert long color names to hex codes
-		if ( $this-&gt;options[&#039;color-long2hex&#039;] ) {
-			$val = $this-&gt;color2hex( $val );
-		}
-
-		// Ensure all hex codes are lowercase
-		if ( preg_match( $this-&gt;rhex, $val ) ) {
-			$val = strtolower( $val );
-		}
-
-		// Convert large hex codes to small codes
-		if ( $this-&gt;options[&#039;color-hex2shorthex&#039;] ) {
-			$val = $this-&gt;hex2short( $val );
-		}
-
-		// Convert 6 digit hex codes to short color names
-		if ( $this-&gt;options[&#039;color-hex2shortcolor&#039;] ) {
-			$val = $this-&gt;hex2color( $val );
-		}
-
-		// Convert safe css level1 color names
-		if ( $this-&gt;options[&#039;color-hex2safe&#039;] ) {
-			$val = $this-&gt;hex2safe( $val );
-		}
-
-		return $val;
-	}
-
-	/**
-	 * Converts rgb values to hex codes
-	 *
-	 * @param (string) val: Color to be converted
-	 */
-	private function rgb2hex( $val ) {
-		if ( ! preg_match( $this-&gt;rrgb, $val, $match ) ) {
-			return $val;
-		}
-
-		// locals
-		$hex = &#039;0123456789abcdef&#039;;
-		$str = explode( &#039;,&#039;, $match[ 1 ] );
-		$new = &#039;&#039;;
-
-		// Incase rgb was defined with single val
-		if ( ! $str ) {
-			$str = array( $match[ 1 ] );
-		}
-
-		foreach ( $str as $x ) {
-			$x = strpos( $x, &#039;%&#039; ) !== false ? intval( ( intval( $x ) / 100 ) * 255 ) : intval( $x );
-
-			if ( $x &gt; 255 ) {
-				$x = 255;
-			}
-
-			if ( $x &lt; 0 ) {
-				$x = 0;
-			}
-
-			$new .= $hex[ ( $x - $x % 16 ) / 16 ];
-			$new .= $hex[ $x % 16 ];
-		}
-
-		// Repeat hex code to complete 6 digit hex requirement for single definitions
-		if ( count( $str ) == 1 ) {
-			$new .= $new . $new;
-		}
-
-		// Replace with hex value
-		return &quot;#$new&quot;;
-	}
-
-	/**
-	 * Convert long color names to hex codes
-	 *
-	 * @param (string) val: Color to be converted
-	 */
-	private function color2hex( $val ) {
-		return isset( self::$color2hex[ $val ] ) ? self::$color2hex[ $val ] : $val;
-	}
-
-	/**
-	 * Convert large hex codes to small codes
-	 *
-	 * @param (string) val: Hex to be shortened
-	 */
-	private function hex2short( $val ) {
-		if ( ! preg_match( $this-&gt;rfullhex, $val, $match ) ) {
-			return $val;
-		}
-
-		// See if we can convert to 3 char hex
-		$hex = $match[ 1 ];
-		if ( $hex[ 0 ] == $hex[ 1 ] &amp;&amp; $hex[ 2 ] == $hex[ 3 ] &amp;&amp; $hex[ 4 ] == $hex[ 5 ] ) {
-			$val = &#039;#&#039; . $hex[ 0 ] . $hex[ 2 ] . $hex[ 4 ];
-		}
-
-		return $val;
-	}
-
-	/**
-	 * Convert large hex codes to small codes
-	 *
-	 * @param (string) val: Color to be converted
-	 */
-	private function hex2color( $val ) {
-		return isset( self::$hex2short[ $val ] ) ? self::$hex2short[ $val ] : $val;
-	}
-
-	/**
-	 * Convert large hex codes to small codes
-	 *
-	 * @param (string) val: Color to be converted
-	 */
-	private function hex2safe( $val ) {
-		return isset( self::$hex2short_safe[ $val ] ) ? self::$hex2short_safe[ $val ] : $val;
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Color Class - &quot; . $method );
-		}
-	}
-};
+class CSSCompression_Color {
+  /**
+   * Color Patterns
+   *
+   * @class Control: Compression Controller
+   * @param (array) options: Reference to options array
+   * @param (regex) rrgb: Checks for rgb notation
+   * @param (regex) rhex: Checks for hex code
+   * @param (regex) rfullhex: Checks for full 6 character hex code
+   * @static (array) color2hex: Long color name to hex code conversions
+   * @static (array) hex2short: Hex code to short color name conversions
+   * @static (array) hex2short_safe: CSS Level 1 safe color names that are shorter than hex codes
+   * @static (array) files: List of static helpers with their class vars
+   */
+  private $Control;
+  private $options = array();
+  private $rrgb = &quot;/^rgb\((\d{1,3}\%?(,\d{1,3}\%?,\d{1,3}\%?)?)\)$/i&quot;;
+  private $rhex = &quot;/^#([0-9a-f]{3}|[0-9a-f]{6})$/i&quot;;
+  private $rfullhex = &quot;/^#([0-9a-f]{6})$/i&quot;;
+  private static $color2hex = array();
+  private static $hex2short = array();
+  private static $hex2short_safe = array();
+  private static $files = array(
+    &#039;color2hex&#039; =&gt; &#039;long2hex-colors.json&#039;,
+    &#039;hex2short&#039; =&gt; &#039;hex2short-colors.json&#039;,
+    &#039;hex2short_safe&#039; =&gt; &#039;hex2short-safe.json&#039;,
+  );
+
+  /**
+   * Stash a reference to the controller on each instantiation
+   * and install conversion helpers
+   *
+   * @param (class) control: CSSCompression Controller
+   */
+  public function __construct( CSSCompression_Control $control ) {
+    $this-&gt;Control = $control;
+    $this-&gt;options = &amp;$control-&gt;Option-&gt;options;
+
+    if ( ! self::$color2hex ) {
+      foreach ( self::$files as $v =&gt; $file ) {
+        self::$$v = CSSCompression::getJSON( $file );
+      }
+    }
+  }
+
+  /**
+   * Central handler for all color conversions.
+   *
+   * @param (string) val: Color to be parsed
+   */
+  public function color( $val ) {
+    // Converts rgb values to hex codes
+    if ( $this-&gt;options[&#039;color-rgb2hex&#039;] ) {
+      $val = $this-&gt;rgb2hex( $val );
+    }
+
+    // Convert long color names to hex codes
+    if ( $this-&gt;options[&#039;color-long2hex&#039;] ) {
+      $val = $this-&gt;color2hex( $val );
+    }
+
+    // Ensure all hex codes are lowercase
+    if ( preg_match( $this-&gt;rhex, $val ) ) {
+      $val = strtolower( $val );
+    }
+
+    // Convert large hex codes to small codes
+    if ( $this-&gt;options[&#039;color-hex2shorthex&#039;] ) {
+      $val = $this-&gt;hex2short( $val );
+    }
+
+    // Convert 6 digit hex codes to short color names
+    if ( $this-&gt;options[&#039;color-hex2shortcolor&#039;] ) {
+      $val = $this-&gt;hex2color( $val );
+    }
+
+    // Convert safe css level1 color names
+    if ( $this-&gt;options[&#039;color-hex2safe&#039;] ) {
+      $val = $this-&gt;hex2safe( $val );
+    }
+
+    return $val;
+  }
+
+  /**
+   * Converts rgb values to hex codes
+   *
+   * @param (string) val: Color to be converted
+   */
+  private function rgb2hex( $val ) {
+    if ( ! preg_match( $this-&gt;rrgb, $val, $match ) ) {
+      return $val;
+    }
+
+    // locals
+    $hex = &#039;0123456789abcdef&#039;;
+    $str = explode( &#039;,&#039;, $match[1] );
+    $new = &#039;&#039;;
+
+    // Incase rgb was defined with single val
+    if ( ! $str ) {
+      $str = array($match[1]);
+    }
+
+    foreach ( $str as $x ) {
+      $x = strpos( $x, &#039;%&#039; ) !== false ? intval( ( intval( $x ) / 100 ) * 255 ) : intval( $x );
+
+      if ( $x &gt; 255 ) {
+        $x = 255;
+      }
+
+      if ( $x &lt; 0 ) {
+        $x = 0;
+      }
+
+      $new .= $hex[( $x - $x % 16 ) / 16];
+      $new .= $hex[$x % 16];
+    }
+
+    // Repeat hex code to complete 6 digit hex requirement for single definitions
+    if ( count( $str ) == 1 ) {
+      $new .= $new . $new;
+    }
+
+    // Replace with hex value
+    return &quot;#$new&quot;;
+  }
+
+  /**
+   * Convert long color names to hex codes
+   *
+   * @param (string) val: Color to be converted
+   */
+  private function color2hex( $val ) {
+    return isset( self::$color2hex[$val] ) ? self::$color2hex[$val] : $val;
+  }
+
+  /**
+   * Convert large hex codes to small codes
+   *
+   * @param (string) val: Hex to be shortened
+   */
+  private function hex2short( $val ) {
+    if ( ! preg_match( $this-&gt;rfullhex, $val, $match ) ) {
+      return $val;
+    }
+
+    // See if we can convert to 3 char hex
+    $hex = $match[1];
+    if ( $hex[0] == $hex[1] &amp;&amp; $hex[2] == $hex[3] &amp;&amp; $hex[4] == $hex[5] ) {
+      $val = &#039;#&#039; . $hex[0] . $hex[2] . $hex[4];
+    }
+
+    return $val;
+  }
+
+  /**
+   * Convert large hex codes to small codes
+   *
+   * @param (string) val: Color to be converted
+   */
+  private function hex2color( $val ) {
+    return isset( self::$hex2short[$val] ) ? self::$hex2short[$val] : $val;
+  }
+
+  /**
+   * Convert large hex codes to small codes
+   *
+   * @param (string) val: Color to be converted
+   */
+  private function hex2safe( $val ) {
+    return isset( self::$hex2short_safe[$val] ) ? self::$hex2short_safe[$val] : $val;
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Color Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Combine/Aural.inc advagg_css_compress/css-compressor-3.x/src/lib/Combine/Aural.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Combine/Aural.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Combine/Aural.inc	2012-03-23 13:02:18.000000000 -0600
@@ -5,103 +5,102 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Combine_Aural
-{
-	/**
-	 * Combine Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @class Combine: Combine Controller
-	 * @param (regex) raural: Aurual matching
-	 */
-	private $Control;
-	private $Combine;
-	private $raural = &quot;/(^|(?&lt;!\\\);)(cue|pause)-(before|after):(.*?)((?&lt;!\\\);|$)/&quot;;
-
-	/**
-	 * Stash a reference to the controller &amp; combiner
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 * @param (class) combine: CSSCompression Combiner
-	 */
-	public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
-		$this-&gt;Control = $control;
-		$this-&gt;Combine = $combine;
-	}
-
-	/**
-	 * Combines Aural properties (currently being depreciated in W3C Standards)
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	public function combine( $val ) {
-		$storage = $this-&gt;storage( $val );
-		$pos = 0;
-
-		// Replace first occurance with it&#039;s prop, and remove all following occurances
-		while ( preg_match( $this-&gt;raural, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			$prop = $match[ 2 ][ 0 ];
-			if ( isset( $storage[ $prop ] ) ) {
-				$colon = strlen( $match[ 1 ][ 0 ] );
-				$val = substr_replace( $val, $storage[ $prop ], $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
-				$pos = $match[ 0 ][ 1 ] + strlen( $storage[ $prop ] ) - $colon - 1;
-				$storage[ $prop ] = &#039;&#039;;
-			}
-			else {
-				$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
-			}
-		}
-
-		// Return converted val
-		return $val;
-	}
-
-	/**
-	 * Builds a storage object for iteration
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	private function storage( $val ) {
-		$storage = array();
-
-		// Find all possible occurences and build the replacement
-		$pos = 0;
-		while ( preg_match( $this-&gt;raural, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			if ( ! isset( $storage[ $match[ 2 ][ 0 ] ] ) ) {
-				$storage[ $match[ 2 ][ 0 ] ] = array( $match[ 3 ][ 0 ] =&gt; $match[ 4 ][ 0 ] );
-			}
-
-			// Override double written properties
-			$storage[ $match[ 2 ][ 0 ] ][ $match[ 3 ][ 0 ] ] = $match[ 4 ][ 0 ];
-			$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
-		}
-
-		// Go through each tag for possible combination
-		foreach ( $storage as $tag =&gt; $arr ) {
-			// All three have to be defined
-			if ( count( $arr ) == 2 &amp;&amp; ! $this-&gt;Combine-&gt;checkUncombinables( $arr ) ) {
-				$storage[ $tag ] = &quot;$tag:&quot; . $arr[&#039;before&#039;] . &#039; &#039; . $arr[&#039;after&#039;] . &#039;;&#039;;
-			}
-			else {
-				unset( $storage[ $tag ] );
-			}
-		}
-
-		return $storage;
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Aural Class - &quot; . $method );
-		}
-	}
-};
+class CSSCompression_Combine_Aural {
+  /**
+   * Combine Patterns
+   *
+   * @class Control: Compression Controller
+   * @class Combine: Combine Controller
+   * @param (regex) raural: Aurual matching
+   */
+  private $Control;
+  private $Combine;
+  private $raural = &quot;/(^|(?&lt;!\\\);)(cue|pause)-(before|after):(.*?)((?&lt;!\\\);|$)/&quot;;
+
+  /**
+   * Stash a reference to the controller &amp; combiner
+   *
+   * @param (class) control: CSSCompression Controller
+   * @param (class) combine: CSSCompression Combiner
+   */
+  public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
+    $this-&gt;Control = $control;
+    $this-&gt;Combine = $combine;
+  }
+
+  /**
+   * Combines Aural properties (currently being depreciated in W3C Standards)
+   *
+   * @param (string) val: Rule Set
+   */
+  public function combine( $val ) {
+    $storage = $this-&gt;storage( $val );
+    $pos = 0;
+
+    // Replace first occurance with it&#039;s prop, and remove all following occurances
+    while ( preg_match( $this-&gt;raural, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      $prop = $match[2][0];
+      if ( isset( $storage[$prop] ) ) {
+        $colon = strlen( $match[1][0] );
+        $val = substr_replace( $val, $storage[$prop], $match[0][1] + $colon, strlen( $match[0][0] ) - $colon );
+        $pos = $match[0][1] + strlen( $storage[$prop] ) - $colon - 1;
+        $storage[$prop] = &#039;&#039;;
+      }
+      else {
+        $pos = $match[0][1] + strlen( $match[0][0] ) - 1;
+      }
+    }
+
+    // Return converted val
+    return $val;
+  }
+
+  /**
+   * Builds a storage object for iteration
+   *
+   * @param (string) val: Rule Set
+   */
+  private function storage( $val ) {
+    $storage = array();
+
+    // Find all possible occurences and build the replacement
+    $pos = 0;
+    while ( preg_match( $this-&gt;raural, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      if ( ! isset( $storage[$match[2][0]] ) ) {
+        $storage[$match[2][0]] = array($match[3][0] =&gt; $match[4][0]);
+      }
+
+      // Override double written properties
+      $storage[$match[2][0]][$match[3][0]] = $match[4][0];
+      $pos = $match[0][1] + strlen( $match[0][0] ) - 1;
+    }
+
+    // Go through each tag for possible combination
+    foreach ( $storage as $tag =&gt; $arr ) {
+      // All three have to be defined
+      if ( count( $arr ) == 2 &amp;&amp; ! $this-&gt;Combine-&gt;checkUncombinables( $arr ) ) {
+        $storage[$tag] = &quot;$tag:&quot; . $arr[&#039;before&#039;] . &#039; &#039; . $arr[&#039;after&#039;] . &#039;;&#039;;
+      }
+      else {
+        unset( $storage[$tag] );
+      }
+    }
+
+    return $storage;
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Aural Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Combine/Background.inc advagg_css_compress/css-compressor-3.x/src/lib/Combine/Background.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Combine/Background.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Combine/Background.inc	2012-03-23 13:02:18.000000000 -0600
@@ -5,101 +5,100 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Combine_Background
-{
-	/**
-	 * Combine Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @class Combine: Combine Controller
-	 * @param (regex) rbackground: Background matching
-	 * @param (array) groupings: List of background combinations
-	 */
-	private $Control;
-	private $Combine;
-	private $rbackground = &quot;/(^|(?&lt;!\\\);)background-(color|image|repeat|attachment|position):(.*?)((?&lt;!\\\);|$)/&quot;;
-	private $groupings = array(
-		// With color
-		array( &#039;color&#039;, &#039;image&#039;, &#039;repeat&#039;, &#039;attachment&#039;, &#039;position&#039; ),
-		array( &#039;color&#039;, &#039;image&#039;, &#039;attachment&#039;, &#039;position&#039; ),
-		array( &#039;color&#039;, &#039;image&#039;, &#039;repeat&#039;, &#039;position&#039; ),
-		array( &#039;color&#039;, &#039;image&#039;, &#039;repeat&#039;, &#039;attachment&#039; ),
-		array( &#039;color&#039;, &#039;image&#039;, &#039;repeat&#039; ),
-		array( &#039;color&#039;, &#039;image&#039;, &#039;attachment&#039; ),
-		array( &#039;color&#039;, &#039;image&#039;, &#039;position&#039; ),
-		array( &#039;color&#039;, &#039;image&#039; ),
-		// Without Color
-		array( &#039;image&#039;, &#039;attachment&#039;, &#039;position&#039; ),
-		array( &#039;image&#039;, &#039;repeat&#039;, &#039;position&#039; ),
-		array( &#039;image&#039;, &#039;repeat&#039;, &#039;attachment&#039; ),
-		array( &#039;image&#039;, &#039;repeat&#039; ),
-		array( &#039;image&#039;, &#039;attachment&#039; ),
-		array( &#039;image&#039;, &#039;position&#039; ),
-		// Just Color/Image
-		array( &#039;image&#039; ),
-		array( &#039;color&#039; ),
-	);
-
-	/**
-	 * Stash a reference to the controller &amp; combiner
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 * @param (class) combine: CSSCompression Combiner
-	 */
-	public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
-		$this-&gt;Control = $control;
-		$this-&gt;Combine = $combine;
-	}
-
-	/**
-	 * Combines multiple background props into single definition
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	public function combine( $val ) {
-		$storage = array();
-
-		// Find all possible occurences and build the replacement
-		$pos = 0;
-		while ( preg_match( $this-&gt;rbackground, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			$storage[ $match[ 2 ][ 0 ] ] = $match[ 3 ][ 0 ];
-			$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
-		}
-
-		// Run background checks and get replacement str
-		foreach ( $this-&gt;groupings as $props ) {
-			if ( $replace = $this-&gt;Combine-&gt;searchDefinitions( &#039;background&#039;, $storage, $props ) ) {
-				break;
-			}
-		}
-
-		// If replacement string found, run it on all declarations
-		if ( $replace ) {
-			$pos = 0;
-			while ( preg_match( $this-&gt;rbackground, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-				$colon = strlen( $match[ 1 ][ 0 ] );
-				$val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
-				$pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1;
-				$replace = &#039;&#039;;
-			}
-		}
-
-		// Return converted val
-		return $val;
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Background Class - &quot; . $method );
-		}
-	}
-};
+class CSSCompression_Combine_Background {
+  /**
+   * Combine Patterns
+   *
+   * @class Control: Compression Controller
+   * @class Combine: Combine Controller
+   * @param (regex) rbackground: Background matching
+   * @param (array) groupings: List of background combinations
+   */
+  private $Control;
+  private $Combine;
+  private $rbackground = &quot;/(^|(?&lt;!\\\);)background-(color|image|repeat|attachment|position):(.*?)((?&lt;!\\\);|$)/&quot;;
+  private $groupings = array(
+    // With color
+    array(&#039;color&#039;, &#039;image&#039;, &#039;repeat&#039;, &#039;attachment&#039;, &#039;position&#039;),
+    array(&#039;color&#039;, &#039;image&#039;, &#039;attachment&#039;, &#039;position&#039;),
+    array(&#039;color&#039;, &#039;image&#039;, &#039;repeat&#039;, &#039;position&#039;),
+    array(&#039;color&#039;, &#039;image&#039;, &#039;repeat&#039;, &#039;attachment&#039;),
+    array(&#039;color&#039;, &#039;image&#039;, &#039;repeat&#039;),
+    array(&#039;color&#039;, &#039;image&#039;, &#039;attachment&#039;),
+    array(&#039;color&#039;, &#039;image&#039;, &#039;position&#039;),
+    array(&#039;color&#039;, &#039;image&#039;),
+    // Without Color
+    array(&#039;image&#039;, &#039;attachment&#039;, &#039;position&#039;),
+    array(&#039;image&#039;, &#039;repeat&#039;, &#039;position&#039;),
+    array(&#039;image&#039;, &#039;repeat&#039;, &#039;attachment&#039;),
+    array(&#039;image&#039;, &#039;repeat&#039;),
+    array(&#039;image&#039;, &#039;attachment&#039;),
+    array(&#039;image&#039;, &#039;position&#039;),
+    // Just Color/Image
+    array(&#039;image&#039;),
+    array(&#039;color&#039;),
+  );
+
+  /**
+   * Stash a reference to the controller &amp; combiner
+   *
+   * @param (class) control: CSSCompression Controller
+   * @param (class) combine: CSSCompression Combiner
+   */
+  public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
+    $this-&gt;Control = $control;
+    $this-&gt;Combine = $combine;
+  }
+
+  /**
+   * Combines multiple background props into single definition
+   *
+   * @param (string) val: Rule Set
+   */
+  public function combine( $val ) {
+    $storage = array();
+
+    // Find all possible occurences and build the replacement
+    $pos = 0;
+    while ( preg_match( $this-&gt;rbackground, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      $storage[$match[2][0]] = $match[3][0];
+      $pos = $match[0][1] + strlen( $match[0][0] ) - 1;
+    }
+
+    // Run background checks and get replacement str
+    foreach ( $this-&gt;groupings as $props ) {
+      if ( $replace = $this-&gt;Combine-&gt;searchDefinitions( &#039;background&#039;, $storage, $props ) ) {
+        break;
+      }
+    }
+
+    // If replacement string found, run it on all declarations
+    if ( $replace ) {
+      $pos = 0;
+      while ( preg_match( $this-&gt;rbackground, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+        $colon = strlen( $match[1][0] );
+        $val = substr_replace( $val, $replace, $match[0][1] + $colon, strlen( $match[0][0] ) - $colon );
+        $pos = $match[0][1] + strlen( $replace ) - $colon - 1;
+        $replace = &#039;&#039;;
+      }
+    }
+
+    // Return converted val
+    return $val;
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Background Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Combine/Border.inc advagg_css_compress/css-compressor-3.x/src/lib/Combine/Border.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Combine/Border.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Combine/Border.inc	2012-03-23 13:02:18.000000000 -0600
@@ -5,92 +5,91 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Combine_Border
-{
-	/**
-	 * Combine Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @class Combine: Combine Controller
-	 * @param (regex) rborder: Border matching
-	 */
-	private $Control;
-	private $Combine;
-	private $rborder = &quot;/(^|(?&lt;!\\\);)border-(top|right|bottom|left):(.*?)((?&lt;!\\\);|$)/&quot;;
-
-	/**
-	 * Stash a reference to the controller &amp; combiner
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 * @param (class) combine: CSSCompression Combiner
-	 */
-	public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
-		$this-&gt;Control = $control;
-		$this-&gt;Combine = $combine;
-	}
-
-	/**
-	 * Combines multiple border properties into single definition
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	public function combine( $val ) {
-		if ( ( $replace = $this-&gt;replace( $val ) ) === false ) {
-			return $val;
-		}
-
-		// Rebuild the rule set with the combinations found
-		$pos = 0;
-		while ( preg_match( $this-&gt;rborder, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			$colon = strlen( $match[ 1 ][ 0 ] );
-			$val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
-			$pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1;
-			$replace = &#039;&#039;;
-		}
-
-		// Return converted val
-		return $val;
-	}
-
-	/**
-	 * Builds a replacement string
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	private function replace( $val ) {
-		$storage = array();
-
-		// Find all possible occurences and build the replacement
-		$pos = 0;
-		while ( preg_match( $this-&gt;rborder, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			// Override double written properties
-			$storage[ $match[ 2 ][ 0 ] ] = $match[ 3 ][ 0 ];
-			$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
-		}
+class CSSCompression_Combine_Border {
+  /**
+   * Combine Patterns
+   *
+   * @class Control: Compression Controller
+   * @class Combine: Combine Controller
+   * @param (regex) rborder: Border matching
+   */
+  private $Control;
+  private $Combine;
+  private $rborder = &quot;/(^|(?&lt;!\\\);)border-(top|right|bottom|left):(.*?)((?&lt;!\\\);|$)/&quot;;
+
+  /**
+   * Stash a reference to the controller &amp; combiner
+   *
+   * @param (class) control: CSSCompression Controller
+   * @param (class) combine: CSSCompression Combiner
+   */
+  public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
+    $this-&gt;Control = $control;
+    $this-&gt;Combine = $combine;
+  }
+
+  /**
+   * Combines multiple border properties into single definition
+   *
+   * @param (string) val: Rule Set
+   */
+  public function combine( $val ) {
+    if ( ( $replace = $this-&gt;replace( $val ) ) === false ) {
+      return $val;
+    }
+
+    // Rebuild the rule set with the combinations found
+    $pos = 0;
+    while ( preg_match( $this-&gt;rborder, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      $colon = strlen( $match[1][0] );
+      $val = substr_replace( $val, $replace, $match[0][1] + $colon, strlen( $match[0][0] ) - $colon );
+      $pos = $match[0][1] + strlen( $replace ) - $colon - 1;
+      $replace = &#039;&#039;;
+    }
+
+    // Return converted val
+    return $val;
+  }
+
+  /**
+   * Builds a replacement string
+   *
+   * @param (string) val: Rule Set
+   */
+  private function replace( $val ) {
+    $storage = array();
+
+    // Find all possible occurences and build the replacement
+    $pos = 0;
+    while ( preg_match( $this-&gt;rborder, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      // Override double written properties
+      $storage[$match[2][0]] = $match[3][0];
+      $pos = $match[0][1] + strlen( $match[0][0] ) - 1;
+    }
 
-		// All 4 have to be defined
-		if ( count( $storage ) == 4 &amp;&amp;
+    // All 4 have to be defined
+    if ( count( $storage ) == 4 &amp;&amp;
 			$storage[&#039;top&#039;] == $storage[&#039;bottom&#039;] &amp;&amp;
 			$storage[&#039;left&#039;] == $storage[&#039;right&#039;] &amp;&amp;
 			$storage[&#039;top&#039;] == $storage[&#039;right&#039;] ) {
-				return &quot;border:&quot; . $storage[&#039;top&#039;] . &#039;;&#039;;
-		}
+      return &quot;border:&quot; . $storage[&#039;top&#039;] . &#039;;&#039;;
+    }
 
-		return false;
-	}
+    return false;
+  }
 
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Border Class - &quot; . $method );
-		}
-	}
-};
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Border Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Combine/BorderOutline.inc advagg_css_compress/css-compressor-3.x/src/lib/Combine/BorderOutline.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Combine/BorderOutline.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Combine/BorderOutline.inc	2012-03-23 13:02:18.000000000 -0600
@@ -5,103 +5,102 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Combine_BorderOutline
-{
-	/**
-	 * Combine Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @class Combine: Combine Controller
-	 * @param (regex) rcsw: Border/Outline matching
-	 */
-	private $Control;
-	private $Combine;
-	private $rcsw = &quot;/(^|(?&lt;!\\\);)(border|border-top|border-bottom|border-left|border-right|outline)-(color|style|width):(.*?)((?&lt;!\\\);|$)/&quot;;
-
-	/**
-	 * Stash a reference to the controller &amp; combiner
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 * @param (class) combine: CSSCompression Combiner
-	 */
-	public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
-		$this-&gt;Control = $control;
-		$this-&gt;Combine = $combine;
-	}
-
-	/**
-	 * Combines color/style/width of border/outline properties
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	public function combine( $val ) {
-		$storage = $this-&gt;storage( $val );
-		$pos = 0;
-
-		// Now rebuild the string replacing all instances
-		while ( preg_match( $this-&gt;rcsw, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			$prop = $match[ 2 ][ 0 ];
-			if ( isset( $storage[ $prop ] ) ) {
-				$colon = strlen( $match[ 1 ][ 0 ] );
-				$val = substr_replace( $val, $storage[ $prop ], $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
-				$pos = $match[ 0 ][ 1 ] + strlen( $storage[ $prop ] ) - $colon - 1;
-				$storage[ $prop ] = &#039;&#039;;
-			}
-			else {
-				$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
-			}
-		}
-
-		// Return converted val
-		return $val;
-	}
-
-	/**
-	 * Builds a storage object for iteration
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	private function storage( $val ) {
-		$storage = array();
-		$pos = 0;
-
-		// Find all possible occurences and build the replacement
-		while ( preg_match( $this-&gt;rcsw, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			if ( ! isset( $storage[ $match[ 2 ][ 0 ] ] ) ) {
-				$storage[ $match[ 2 ][ 0 ] ] = array( $match[ 3 ][ 0 ] =&gt; $match[ 4 ][ 0 ] );
-			}
-
-			// Override double written properties
-			$storage[ $match[ 2 ][ 0 ] ][ $match[ 3 ][ 0 ] ] = $match[ 4 ][ 0 ];
-			$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
-		}
-
-		// Go through each tag for possible combination
-		foreach ( $storage as $tag =&gt; $arr ) {
-			// All three have to be defined
-			if ( count( $arr ) == 3 &amp;&amp; ! $this-&gt;Combine-&gt;checkUncombinables( $arr ) ) {
-				$storage[ $tag ] = &quot;$tag:&quot; . $arr[&#039;width&#039;] . &#039; &#039; . $arr[&#039;style&#039;] . &#039; &#039; . $arr[&#039;color&#039;] . &#039;;&#039;;
-			}
-			else {
-				unset( $storage[ $tag ] );
-			}
-		}
-
-		return $storage;
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in BorderOutline Class - &quot; . $method );
-		}
-	}
-};
+class CSSCompression_Combine_BorderOutline {
+  /**
+   * Combine Patterns
+   *
+   * @class Control: Compression Controller
+   * @class Combine: Combine Controller
+   * @param (regex) rcsw: Border/Outline matching
+   */
+  private $Control;
+  private $Combine;
+  private $rcsw = &quot;/(^|(?&lt;!\\\);)(border|border-top|border-bottom|border-left|border-right|outline)-(color|style|width):(.*?)((?&lt;!\\\);|$)/&quot;;
+
+  /**
+   * Stash a reference to the controller &amp; combiner
+   *
+   * @param (class) control: CSSCompression Controller
+   * @param (class) combine: CSSCompression Combiner
+   */
+  public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
+    $this-&gt;Control = $control;
+    $this-&gt;Combine = $combine;
+  }
+
+  /**
+   * Combines color/style/width of border/outline properties
+   *
+   * @param (string) val: Rule Set
+   */
+  public function combine( $val ) {
+    $storage = $this-&gt;storage( $val );
+    $pos = 0;
+
+    // Now rebuild the string replacing all instances
+    while ( preg_match( $this-&gt;rcsw, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      $prop = $match[2][0];
+      if ( isset( $storage[$prop] ) ) {
+        $colon = strlen( $match[1][0] );
+        $val = substr_replace( $val, $storage[$prop], $match[0][1] + $colon, strlen( $match[0][0] ) - $colon );
+        $pos = $match[0][1] + strlen( $storage[$prop] ) - $colon - 1;
+        $storage[$prop] = &#039;&#039;;
+      }
+      else {
+        $pos = $match[0][1] + strlen( $match[0][0] ) - 1;
+      }
+    }
+
+    // Return converted val
+    return $val;
+  }
+
+  /**
+   * Builds a storage object for iteration
+   *
+   * @param (string) val: Rule Set
+   */
+  private function storage( $val ) {
+    $storage = array();
+    $pos = 0;
+
+    // Find all possible occurences and build the replacement
+    while ( preg_match( $this-&gt;rcsw, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      if ( ! isset( $storage[$match[2][0]] ) ) {
+        $storage[$match[2][0]] = array($match[3][0] =&gt; $match[4][0]);
+      }
+
+      // Override double written properties
+      $storage[$match[2][0]][$match[3][0]] = $match[4][0];
+      $pos = $match[0][1] + strlen( $match[0][0] ) - 1;
+    }
+
+    // Go through each tag for possible combination
+    foreach ( $storage as $tag =&gt; $arr ) {
+      // All three have to be defined
+      if ( count( $arr ) == 3 &amp;&amp; ! $this-&gt;Combine-&gt;checkUncombinables( $arr ) ) {
+        $storage[$tag] = &quot;$tag:&quot; . $arr[&#039;width&#039;] . &#039; &#039; . $arr[&#039;style&#039;] . &#039; &#039; . $arr[&#039;color&#039;] . &#039;;&#039;;
+      }
+      else {
+        unset( $storage[$tag] );
+      }
+    }
+
+    return $storage;
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in BorderOutline Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Combine/BorderRadius.inc advagg_css_compress/css-compressor-3.x/src/lib/Combine/BorderRadius.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Combine/BorderRadius.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Combine/BorderRadius.inc	2012-03-23 13:02:18.000000000 -0600
@@ -5,257 +5,259 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Combine_BorderRadius
-{
-	/**
-	 * Combine Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @class Combine: Combine Controller
-	 * @param (regex) rspace: Checks for space without an escape &#039;\&#039; character before it
-	 * @param (regex) rslash: Checks for unescaped slash character
-	 * @param (array) borderRadius: Various border radii components
-	 */
-	private $Control;
-	private $Combine;
-	private $rspace = &quot;/(?&lt;!\\\)\s/&quot;;
-	private $rslash = &quot;/(?&lt;!\\\)\//&quot;;
-	private $borderRadius = array(
-		&#039;css3&#039; =&gt; array(
-			&#039;mod&#039; =&gt; &#039;&#039;,
-			&#039;base&#039; =&gt; &quot;/(^|(?&lt;!\\\);)border-radius:(.*?)((?&lt;!\\\);|$)/&quot;,
-			&#039;full&#039; =&gt; &quot;/(^|(?&lt;!\\\);)border-(top|bottom)-(left|right)-radius:(.*?)((?&lt;!\\\);|$)/&quot;,
-		),
-		&#039;moz&#039; =&gt; array(
-			&#039;mod&#039; =&gt; &#039;-moz-&#039;,
-			&#039;base&#039; =&gt; &quot;/(^|(?&lt;!\\\);)-moz-border-radius:(.*?)((?&lt;!\\\);|$)/&quot;,
-			&#039;full&#039; =&gt; &quot;/(^|(?&lt;!\\\);)-moz-border-radius-(top|bottom)(left|right):(.*?)((?&lt;!\\\);|$)/&quot;
-		),
-		&#039;webkit&#039; =&gt; array(
-			&#039;mod&#039; =&gt; &#039;-webkit-&#039;,
-			&#039;base&#039; =&gt; &quot;/(^|(?&lt;!\\\);)-webkit-border-radius:(.*?)((?&lt;!\\\);|$)/&quot;,
-			&#039;full&#039; =&gt; &quot;/(^|(?&lt;!\\\);)-webkit-border-(top|bottom)-(left|right)-radius:(.*?)((?&lt;!\\\);|$)/&quot;
-		),
-	);
-
-	/**
-	 * Stash a reference to the controller &amp; combiner
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 * @param (class) combine: CSSCompression Combiner
-	 */
-	public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
-		$this-&gt;Control = $control;
-		$this-&gt;Combine = $combine;
-	}
-
-
-	/**
-	 * Main handler to combine border-radii into a single rule
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	public function combine( $val ) {
-		foreach ( $this-&gt;borderRadius as $regex ) {
-			$val = $this-&gt;fix( $val, $regex );
-		}
-
-		return $val;
-	}
-
-	/**
-	 * Does the actual combining
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	private function fix( $val, $regex ) {
-		$val = $this-&gt;base( $val, $regex );
-		$replace = $regex[&#039;mod&#039;];
-
-		// Storage builder
-		if ( ( $storage = $this-&gt;storage( $val, $regex ) ) === false ) {
-			return $val;
-		}
-
-		// Setup horizontal/vertical radii
-		foreach ( $storage as $dir =&gt; &amp;$config ) {
-			// Verticals are optional
-			if ( $dir == &#039;vertical&#039; &amp;&amp; ! $config[&#039;keep&#039;] ) {
-				break;
-			}
-			// All 4 are the same
-			else if ( $config[&#039;top-left&#039;] == $config[&#039;top-right&#039;] &amp;&amp;
+class CSSCompression_Combine_BorderRadius {
+  /**
+   * Combine Patterns
+   *
+   * @class Control: Compression Controller
+   * @class Combine: Combine Controller
+   * @param (regex) rspace: Checks for space without an escape &#039;\&#039; character before it
+   * @param (regex) rslash: Checks for unescaped slash character
+   * @param (array) borderRadius: Various border radii components
+   */
+  private $Control;
+  private $Combine;
+  private $rspace = &quot;/(?&lt;!\\\)\s/&quot;;
+  private $rslash = &quot;/(?&lt;!\\\)\//&quot;;
+  private $borderRadius = array(
+    &#039;css3&#039; =&gt; array(
+      &#039;mod&#039; =&gt; &#039;&#039;,
+      &#039;base&#039; =&gt; &quot;/(^|(?&lt;!\\\);)border-radius:(.*?)((?&lt;!\\\);|$)/&quot;,
+      &#039;full&#039; =&gt; &quot;/(^|(?&lt;!\\\);)border-(top|bottom)-(left|right)-radius:(.*?)((?&lt;!\\\);|$)/&quot;,
+    ),
+    &#039;moz&#039; =&gt; array(
+      &#039;mod&#039; =&gt; &#039;-moz-&#039;,
+      &#039;base&#039; =&gt; &quot;/(^|(?&lt;!\\\);)-moz-border-radius:(.*?)((?&lt;!\\\);|$)/&quot;,
+      &#039;full&#039; =&gt; &quot;/(^|(?&lt;!\\\);)-moz-border-radius-(top|bottom)(left|right):(.*?)((?&lt;!\\\);|$)/&quot;,
+    ),
+    &#039;webkit&#039; =&gt; array(
+      &#039;mod&#039; =&gt; &#039;-webkit-&#039;,
+      &#039;base&#039; =&gt; &quot;/(^|(?&lt;!\\\);)-webkit-border-radius:(.*?)((?&lt;!\\\);|$)/&quot;,
+      &#039;full&#039; =&gt; &quot;/(^|(?&lt;!\\\);)-webkit-border-(top|bottom)-(left|right)-radius:(.*?)((?&lt;!\\\);|$)/&quot;,
+    ),
+  );
+
+  /**
+   * Stash a reference to the controller &amp; combiner
+   *
+   * @param (class) control: CSSCompression Controller
+   * @param (class) combine: CSSCompression Combiner
+   */
+  public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
+    $this-&gt;Control = $control;
+    $this-&gt;Combine = $combine;
+  }
+
+
+  /**
+   * Main handler to combine border-radii into a single rule
+   *
+   * @param (string) val: Rule Set
+   */
+  public function combine( $val ) {
+    foreach ( $this-&gt;borderRadius as $regex ) {
+      $val = $this-&gt;fix( $val, $regex );
+    }
+
+    return $val;
+  }
+
+  /**
+   * Does the actual combining
+   *
+   * @param (string) val: Rule Set
+   */
+  private function fix( $val, $regex ) {
+    $val = $this-&gt;base( $val, $regex );
+    $replace = $regex[&#039;mod&#039;];
+
+    // Storage builder
+    if ( ( $storage = $this-&gt;storage( $val, $regex ) ) === false ) {
+      return $val;
+    }
+
+    // Setup horizontal/vertical radii
+    foreach ( $storage as $dir =&gt; &amp;$config ) {
+      // Verticals are optional
+      if ( $dir == &#039;vertical&#039; &amp;&amp; ! $config[&#039;keep&#039;] ) {
+        break;
+      }
+      // All 4 are the same
+      else if ( $config[&#039;top-left&#039;] == $config[&#039;top-right&#039;] &amp;&amp;
 				$config[&#039;top-right&#039;] == $config[&#039;bottom-right&#039;] &amp;&amp;
 				$config[&#039;bottom-right&#039;] == $config[&#039;bottom-left&#039;] ) {
-					$config[&#039;replace&#039;] .= $config[&#039;top-left&#039;];
-			}
-			// Opposites are the same
-			else if ( $config[&#039;top-left&#039;] == $config[&#039;bottom-right&#039;] &amp;&amp; $config[&#039;top-right&#039;] == $config[&#039;bottom-left&#039;] ) {
-				$config[&#039;replace&#039;] .= $config[&#039;top-left&#039;] . &#039; &#039; . $config[&#039;top-right&#039;];
-			}
-			// 3-point directional
-			else if ( $config[&#039;top-right&#039;] == $config[&#039;bottom-left&#039;] ) {
-				$config[&#039;replace&#039;] .= $config[&#039;top-left&#039;] . &#039; &#039; . $config[&#039;top-right&#039;] . &#039; &#039; . $config[&#039;bottom-right&#039;];
-			}
-			// none are the same, but can still use shorthand notation
-			else {
-				$config[&#039;replace&#039;] .= $config[&#039;top-left&#039;] . &#039; &#039; . $config[&#039;top-right&#039;] . &#039; &#039;
+        $config[&#039;replace&#039;] .= $config[&#039;top-left&#039;];
+      }
+      // Opposites are the same
+      else if ( $config[&#039;top-left&#039;] == $config[&#039;bottom-right&#039;] &amp;&amp; $config[&#039;top-right&#039;] == $config[&#039;bottom-left&#039;] ) {
+        $config[&#039;replace&#039;] .= $config[&#039;top-left&#039;] . &#039; &#039; . $config[&#039;top-right&#039;];
+      }
+      // 3-point directional
+      else if ( $config[&#039;top-right&#039;] == $config[&#039;bottom-left&#039;] ) {
+        $config[&#039;replace&#039;] .= $config[&#039;top-left&#039;] . &#039; &#039; . $config[&#039;top-right&#039;] . &#039; &#039; . $config[&#039;bottom-right&#039;];
+      }
+      // none are the same, but can still use shorthand notation
+      else {
+        $config[&#039;replace&#039;] .= $config[&#039;top-left&#039;] . &#039; &#039; . $config[&#039;top-right&#039;] . &#039; &#039;
 					. $config[&#039;bottom-right&#039;] . &#039; &#039; . $config[&#039;bottom-left&#039;];
-			}
-		}
+      }
+    }
 
-		// Now rebuild the string replacing all instances of margin/padding if shorthand exists
-		$pos = 0;
-		$replace = $regex[&#039;mod&#039;] . &quot;border-radius:&quot; . $storage[&#039;horizontal&#039;][&#039;replace&#039;] . $storage[&#039;vertical&#039;][&#039;replace&#039;] . &#039;;&#039;;
-		while ( preg_match( $regex[&#039;full&#039;], $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			$colon = strlen( $match[ 1 ][ 0 ] );
-			$val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
-			$pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1;
-			$replace = &#039;&#039;;
-		}
-
-		// Return converted val
-		return $val;
-	}
-
-	/**
-	 * Expands short handed border radius props for combination
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	private function base( $val, $regex ) {
-		$pos = 0;
-		while ( preg_match( $regex[&#039;base&#039;], $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			$replace = &#039;&#039;;
-			$colon = strlen( $match[ 1 ][ 0 ] );
-			$parts = preg_split( $this-&gt;rslash, trim( $match[ 2 ][ 0 ] ), 2 );
-			$positions = array(
-				&#039;top-left&#039; =&gt; 0,
-				&#039;top-right&#039; =&gt; 0,
-				&#039;bottom-right&#039; =&gt; 0,
-				&#039;bottom-left&#039; =&gt; 0,
-			);
-			$base = array(
-				&#039;horizontal&#039; =&gt; array(
-					&#039;parts&#039; =&gt; preg_split( $this-&gt;rspace, trim( $parts[ 0 ] ) ),
-					&#039;pos&#039; =&gt; $positions,
-				),
-				&#039;vertical&#039; =&gt; array(
-					&#039;parts&#039; =&gt; isset( $parts[ 1 ] ) ? preg_split( $this-&gt;rspace, trim( $parts[ 1 ] ) ) : &#039;&#039;,
-					&#039;pos&#039; =&gt; $positions,
-				),
-			);
-
-			foreach ( $base as &amp;$config ) {
-				// Skip uncombinables
-				if ( $this-&gt;Combine-&gt;checkUncombinables( $config[&#039;parts&#039;] ) ) {
-					$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
-					continue 2;
-				}
-				// Might not have verticals
-				else if ( $config[&#039;parts&#039;] === &#039;&#039; ) {
-					continue;
-				}
-
-				// Each position needs a value
-				switch ( count( $config[&#039;parts&#039;] ) ) {
-					case 1:
-						$config[&#039;pos&#039;][&#039;top-left&#039;] = $config[&#039;pos&#039;][&#039;top-right&#039;] = $config[&#039;parts&#039;][ 0 ];
-						$config[&#039;pos&#039;][&#039;bottom-left&#039;] = $config[&#039;pos&#039;][&#039;bottom-right&#039;] = $config[&#039;parts&#039;][ 0 ];
-						break;
-					case 2:
-						$config[&#039;pos&#039;][&#039;top-left&#039;] = $config[&#039;pos&#039;][&#039;bottom-right&#039;] = $config[&#039;parts&#039;][ 0 ];
-						$config[&#039;pos&#039;][&#039;bottom-left&#039;] = $config[&#039;pos&#039;][&#039;top-right&#039;] = $config[&#039;parts&#039;][ 1 ];
-						break;
-					case 3:
-						$config[&#039;pos&#039;][&#039;top-left&#039;] = $config[&#039;parts&#039;][ 0 ];
-						$config[&#039;pos&#039;][&#039;bottom-left&#039;] = $config[&#039;pos&#039;][&#039;top-right&#039;] = $config[&#039;parts&#039;][ 1 ];
-						$config[&#039;pos&#039;][&#039;bottom-right&#039;] = $config[&#039;parts&#039;][ 2 ];
-						break;
-					case 4:
-						$config[&#039;pos&#039;][&#039;top-left&#039;] = $config[&#039;parts&#039;][ 0 ];
-						$config[&#039;pos&#039;][&#039;top-right&#039;] = $config[&#039;parts&#039;][ 1 ];
-						$config[&#039;pos&#039;][&#039;bottom-right&#039;] = $config[&#039;parts&#039;][ 2 ];
-						$config[&#039;pos&#039;][&#039;bottom-left&#039;] = $config[&#039;parts&#039;][ 3 ];
-						break;
-					default:
-						continue 2;
-				}
-
-			}
-
-			// Build the replacement
-			foreach ( $positions as $p =&gt; $v ) {
-				if ( $regex[&#039;mod&#039;] == &#039;-moz-&#039; ) {
-					$replace .= &quot;-moz-border-radius-&quot; . preg_replace( &quot;/-/&quot;, &#039;&#039;, $p ) . &quot;:&quot;
-						. $base[&#039;horizontal&#039;][&#039;pos&#039;][ $p ]
-						. ( $base[&#039;vertical&#039;][&#039;parts&#039;] === &#039;&#039; ? &#039;&#039; : &#039; &#039; . $base[&#039;vertical&#039;][&#039;pos&#039;][ $p ] )
+    // Now rebuild the string replacing all instances of margin/padding if shorthand exists
+    $pos = 0;
+    $replace = $regex[&#039;mod&#039;] . &quot;border-radius:&quot; . $storage[&#039;horizontal&#039;][&#039;replace&#039;] . $storage[&#039;vertical&#039;][&#039;replace&#039;] . &#039;;&#039;;
+    while ( preg_match( $regex[&#039;full&#039;], $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      $colon = strlen( $match[1][0] );
+      $val = substr_replace( $val, $replace, $match[0][1] + $colon, strlen( $match[0][0] ) - $colon );
+      $pos = $match[0][1] + strlen( $replace ) - $colon - 1;
+      $replace = &#039;&#039;;
+    }
+
+    // Return converted val
+    return $val;
+  }
+
+  /**
+   * Expands short handed border radius props for combination
+   *
+   * @param (string) val: Rule Set
+   */
+  private function base( $val, $regex ) {
+    $pos = 0;
+    while ( preg_match( $regex[&#039;base&#039;], $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      $replace = &#039;&#039;;
+      $colon = strlen( $match[1][0] );
+      $parts = preg_split( $this-&gt;rslash, trim( $match[2][0] ), 2 );
+      $positions = array(
+        &#039;top-left&#039; =&gt; 0,
+        &#039;top-right&#039; =&gt; 0,
+        &#039;bottom-right&#039; =&gt; 0,
+        &#039;bottom-left&#039; =&gt; 0,
+      );
+      $base = array(
+        &#039;horizontal&#039; =&gt; array(
+          &#039;parts&#039; =&gt; preg_split( $this-&gt;rspace, trim( $parts[0] ) ),
+          &#039;pos&#039; =&gt; $positions,
+        ),
+        &#039;vertical&#039; =&gt; array(
+          &#039;parts&#039; =&gt; isset( $parts[1] ) ? preg_split( $this-&gt;rspace, trim( $parts[1] ) ) : &#039;&#039;,
+          &#039;pos&#039; =&gt; $positions,
+        ),
+      );
+
+      foreach ( $base as &amp;$config ) {
+        // Skip uncombinables
+        if ( $this-&gt;Combine-&gt;checkUncombinables( $config[&#039;parts&#039;] ) ) {
+          $pos = $match[0][1] + strlen( $match[0][0] ) - 1;
+          continue 2;
+        }
+        // Might not have verticals
+        else if ( $config[&#039;parts&#039;] === &#039;&#039; ) {
+          continue;
+        }
+
+        // Each position needs a value
+        switch ( count( $config[&#039;parts&#039;] ) ) {
+          case 1:
+            $config[&#039;pos&#039;][&#039;top-left&#039;] = $config[&#039;pos&#039;][&#039;top-right&#039;] = $config[&#039;parts&#039;][0];
+            $config[&#039;pos&#039;][&#039;bottom-left&#039;] = $config[&#039;pos&#039;][&#039;bottom-right&#039;] = $config[&#039;parts&#039;][0];
+            break;
+          case 2:
+            $config[&#039;pos&#039;][&#039;top-left&#039;] = $config[&#039;pos&#039;][&#039;bottom-right&#039;] = $config[&#039;parts&#039;][0];
+            $config[&#039;pos&#039;][&#039;bottom-left&#039;] = $config[&#039;pos&#039;][&#039;top-right&#039;] = $config[&#039;parts&#039;][1];
+            break;
+          case 3:
+            $config[&#039;pos&#039;][&#039;top-left&#039;] = $config[&#039;parts&#039;][0];
+            $config[&#039;pos&#039;][&#039;bottom-left&#039;] = $config[&#039;pos&#039;][&#039;top-right&#039;] = $config[&#039;parts&#039;][1];
+            $config[&#039;pos&#039;][&#039;bottom-right&#039;] = $config[&#039;parts&#039;][2];
+            break;
+          case 4:
+            $config[&#039;pos&#039;][&#039;top-left&#039;] = $config[&#039;parts&#039;][0];
+            $config[&#039;pos&#039;][&#039;top-right&#039;] = $config[&#039;parts&#039;][1];
+            $config[&#039;pos&#039;][&#039;bottom-right&#039;] = $config[&#039;parts&#039;][2];
+            $config[&#039;pos&#039;][&#039;bottom-left&#039;] = $config[&#039;parts&#039;][3];
+            break;
+          default:
+            continue 2;
+        }
+
+      }
+
+      // Build the replacement
+      foreach ( $positions as $p =&gt; $v ) {
+        if ( $regex[&#039;mod&#039;] == &#039;-moz-&#039; ) {
+          $replace .= &quot;-moz-border-radius-&quot; . preg_replace( &quot;/-/&quot;, &#039;&#039;, $p ) . &quot;:&quot;
+						. $base[&#039;horizontal&#039;][&#039;pos&#039;][$p]
+						. ( $base[&#039;vertical&#039;][&#039;parts&#039;] === &#039;&#039; ? &#039;&#039; : &#039; &#039; . $base[&#039;vertical&#039;][&#039;pos&#039;][$p] )
 						. &#039;;&#039;;
-				}
-				else {
-					$replace .= $regex[&#039;mod&#039;] . &quot;border-$p-radius:&quot;
-						. $base[&#039;horizontal&#039;][&#039;pos&#039;][ $p ]
-						. ( $base[&#039;vertical&#039;][&#039;parts&#039;] === &#039;&#039; ? &#039;&#039; : &#039; &#039; . $base[&#039;vertical&#039;][&#039;pos&#039;][ $p ] )
+        }
+        else {
+          $replace .= $regex[&#039;mod&#039;] . &quot;border-$p-radius:&quot;
+						. $base[&#039;horizontal&#039;][&#039;pos&#039;][$p]
+						. ( $base[&#039;vertical&#039;][&#039;parts&#039;] === &#039;&#039; ? &#039;&#039; : &#039; &#039; . $base[&#039;vertical&#039;][&#039;pos&#039;][$p] )
 						. &#039;;&#039;;
-				}
-			}
-			$pos += strlen( $replace );
-			$val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
-		}
-
-		return $val;
-	}
-
-	/**
-	 * Builds the storage object for border radius props
-	 *
-	 * @param (string) val: Rule Set
-	 * @param (array) regex: Current border radius type checking props
-	 */
-	private function storage( $val, $regex ) {
-		$storage = array(
-			&#039;horizontal&#039; =&gt; array( &#039;replace&#039; =&gt; &#039;&#039; ),
-			&#039;vertical&#039; =&gt; array( &#039;replace&#039; =&gt; &#039;&#039;, &#039;keep&#039; =&gt; false ),
-		);
-
-		// Find all possible occurences of this border-radius type and mark their directional value
-		$pos = 0;
-		while ( preg_match( $regex[&#039;full&#039;], $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
-			$parts = preg_split( $this-&gt;rspace, $match[ 4 ][ 0 ], 2 );
-			$storage[&#039;horizontal&#039;][ $match[ 2 ][ 0 ] . &#039;-&#039; . $match[ 3 ][ 0 ] ] = trim( $parts[ 0 ] );
-			if ( isset( $parts[ 1 ] ) ) {
-				$storage[&#039;vertical&#039;][ $match[ 2 ][ 0 ] . &#039;-&#039; . $match[ 3 ][ 0 ] ] = trim( $parts[ 1 ] );
-				$storage[&#039;vertical&#039;][&#039;keep&#039;] = true;
-				$storage[&#039;vertical&#039;][&#039;replace&#039;] = &#039;/&#039;;
-			}
-			else {
-				$storage[&#039;vertical&#039;][ $match[ 2 ][ 0 ] . &#039;-&#039; . $match[ 3 ][ 0 ] ] = &#039;0&#039;;
-			}
-		}
+        }
+      }
+      $pos += strlen( $replace );
+      $val = substr_replace( $val, $replace, $match[0][1] + $colon, strlen( $match[0][0] ) - $colon );
+    }
+
+    return $val;
+  }
+
+  /**
+   * Builds the storage object for border radius props
+   *
+   * @param (string) val: Rule Set
+   * @param (array) regex: Current border radius type checking props
+   */
+  private function storage( $val, $regex ) {
+    $storage = array(
+      &#039;horizontal&#039; =&gt; array(&#039;replace&#039; =&gt; &#039;&#039;),
+      &#039;vertical&#039; =&gt; array(
+        &#039;replace&#039; =&gt; &#039;&#039;,
+        &#039;keep&#039; =&gt; false,
+      ),
+    );
+
+    // Find all possible occurences of this border-radius type and mark their directional value
+    $pos = 0;
+    while ( preg_match( $regex[&#039;full&#039;], $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      $pos = $match[0][1] + strlen( $match[0][0] ) - 1;
+      $parts = preg_split( $this-&gt;rspace, $match[4][0], 2 );
+      $storage[&#039;horizontal&#039;][$match[2][0] . &#039;-&#039; . $match[3][0]] = trim( $parts[0] );
+      if ( isset( $parts[1] ) ) {
+        $storage[&#039;vertical&#039;][$match[2][0] . &#039;-&#039; . $match[3][0]] = trim( $parts[1] );
+        $storage[&#039;vertical&#039;][&#039;keep&#039;] = true;
+        $storage[&#039;vertical&#039;][&#039;replace&#039;] = &#039;/&#039;;
+      }
+      else {
+        $storage[&#039;vertical&#039;][$match[2][0] . &#039;-&#039; . $match[3][0]] = &#039;0&#039;;
+      }
+    }
 
-		// Only combine if all 4 definitions are found (5 including replace)
-		if ( count( $storage[&#039;horizontal&#039;] ) != 5 ||
+    // Only combine if all 4 definitions are found (5 including replace)
+    if ( count( $storage[&#039;horizontal&#039;] ) != 5 ||
 			$this-&gt;Combine-&gt;checkUncombinables( $storage[&#039;horizontal&#039;] ) ||
 			$this-&gt;Combine-&gt;checkUncombinables( $storage[&#039;vertical&#039;] ) ) {
-				return false;
-		}
+      return false;
+    }
 
-		return $storage;
-	}
+    return $storage;
+  }
 
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in BorderRadius Class - &quot; . $method );
-		}
-	}
-};
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in BorderRadius Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Combine/Font.inc advagg_css_compress/css-compressor-3.x/src/lib/Combine/Font.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Combine/Font.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Combine/Font.inc	2012-03-23 13:02:18.000000000 -0600
@@ -5,119 +5,118 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Combine_Font
-{
-	/**
-	 * Combine Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @class Combine: Combine Controller
-	 * @param (regex) rfont: Font matching
-	 * @param (array) groupings: Set of font combinationals
-	 */
-	private $Control;
-	private $Combine;
-	private $rfont = &quot;/(^|(?&lt;!\\\);)(font|line)-(style|variant|weight|size|height|family):(.*?)((?&lt;!\\\);|$)/&quot;;
-	private $groupings = array(
-		array( &#039;font-style&#039;, &#039;font-variant&#039;, &#039;font-weight&#039;, &#039;size/height&#039;, &#039;font-family&#039; ),
-		array( &#039;font-style&#039;, &#039;font-variant&#039;, &#039;font-weight&#039;, &#039;font-size&#039;, &#039;font-family&#039; ),
-		array( &#039;font-style&#039;, &#039;font-variant&#039;, &#039;size/height&#039;, &#039;font-family&#039; ),
-		array( &#039;font-style&#039;, &#039;font-variant&#039;, &#039;font-size&#039;, &#039;font-family&#039; ),
-		array( &#039;font-style&#039;, &#039;font-weight&#039;, &#039;size/height&#039;, &#039;font-family&#039; ),
-		array( &#039;font-style&#039;, &#039;font-weight&#039;, &#039;font-size&#039;, &#039;font-family&#039; ),
-		array( &#039;font-variant&#039;, &#039;font-weight&#039;, &#039;size/height&#039;, &#039;font-family&#039; ),
-		array( &#039;font-variant&#039;, &#039;font-weight&#039;, &#039;font-size&#039;, &#039;font-family&#039; ),
-		array( &#039;font-weight&#039;, &#039;size/height&#039;, &#039;font-family&#039; ),
-		array( &#039;font-weight&#039;, &#039;font-size&#039;, &#039;font-family&#039; ),
-		array( &#039;font-variant&#039;, &#039;size/height&#039;, &#039;font-family&#039; ),
-		array( &#039;font-variant&#039;, &#039;font-size&#039;, &#039;font-family&#039; ),
-		array( &#039;font-style&#039;, &#039;size/height&#039;, &#039;font-family&#039; ),
-		array( &#039;font-style&#039;, &#039;font-size&#039;, &#039;font-family&#039; ),
-		array( &#039;size/height&#039;, &#039;font-family&#039; ),
-		array( &#039;font-size&#039;, &#039;font-family&#039; ),
-	);
-
-	/**
-	 * Stash a reference to the controller &amp; combiner
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 * @param (class) combine: CSSCompression Combiner
-	 */
-	public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
-		$this-&gt;Control = $control;
-		$this-&gt;Combine = $combine;
-	}
-
-	/**
-	 * Combines multiple font-definitions into single definition
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	public function combine( $val ) {
-		$storage = $this-&gt;storage( $val );
-
-		// Loop through each property check and see if they can be replaced
-		foreach ( $this-&gt;groupings as $props ) {
-			if ( $replace = $this-&gt;Combine-&gt;searchDefinitions( &#039;font&#039;, $storage, $props ) ) {
-				break;
-			}
-		}
-
-		// If replacement string found, run it on all declarations
-		if ( $replace ) {
-			$pos = 0;
-			while ( preg_match( $this-&gt;rfont, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-				if ( ! isset( $storage[&#039;line-height&#039;] ) &amp;&amp; stripos( $match[ 0 ][ 0 ], &#039;line-height&#039;) === 0 ) {
-					$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
-					continue;
-				}
-				$colon = strlen( $match[ 1 ][ 0 ] );
-				$val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
-				$pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1;
-				$replace = &#039;&#039;;
-			}
-		}
-
-		// Return converted val
-		return $val;
-	}
-
-	/**
-	 * Builds a storage object for iteration
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	private function storage( $val ) {
-		$storage = array();
-
-		// Find all possible occurences and build the replacement
-		$pos = 0;
-		while ( preg_match( $this-&gt;rfont, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			$storage[ $match[ 2 ][ 0 ] . &#039;-&#039; . $match[ 3 ][ 0 ] ] = $match[ 4 ][ 0 ];
-			$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
-		}
-
-		// Combine font-size &amp; line-height if possible
-		if ( isset( $storage[&#039;font-size&#039;] ) &amp;&amp; isset( $storage[&#039;line-height&#039;] ) ) {
-			$storage[&#039;size/height&#039;] = $storage[&#039;font-size&#039;] . &#039;/&#039; . $storage[&#039;line-height&#039;];
-			unset( $storage[&#039;font-size&#039;], $storage[&#039;line-height&#039;] );
-		}
-
-		return $storage;
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Font Class - &quot; . $method );
-		}
-	}
-};
+class CSSCompression_Combine_Font {
+  /**
+   * Combine Patterns
+   *
+   * @class Control: Compression Controller
+   * @class Combine: Combine Controller
+   * @param (regex) rfont: Font matching
+   * @param (array) groupings: Set of font combinationals
+   */
+  private $Control;
+  private $Combine;
+  private $rfont = &quot;/(^|(?&lt;!\\\);)(font|line)-(style|variant|weight|size|height|family):(.*?)((?&lt;!\\\);|$)/&quot;;
+  private $groupings = array(
+    array(&#039;font-style&#039;, &#039;font-variant&#039;, &#039;font-weight&#039;, &#039;size/height&#039;, &#039;font-family&#039;),
+    array(&#039;font-style&#039;, &#039;font-variant&#039;, &#039;font-weight&#039;, &#039;font-size&#039;, &#039;font-family&#039;),
+    array(&#039;font-style&#039;, &#039;font-variant&#039;, &#039;size/height&#039;, &#039;font-family&#039;),
+    array(&#039;font-style&#039;, &#039;font-variant&#039;, &#039;font-size&#039;, &#039;font-family&#039;),
+    array(&#039;font-style&#039;, &#039;font-weight&#039;, &#039;size/height&#039;, &#039;font-family&#039;),
+    array(&#039;font-style&#039;, &#039;font-weight&#039;, &#039;font-size&#039;, &#039;font-family&#039;),
+    array(&#039;font-variant&#039;, &#039;font-weight&#039;, &#039;size/height&#039;, &#039;font-family&#039;),
+    array(&#039;font-variant&#039;, &#039;font-weight&#039;, &#039;font-size&#039;, &#039;font-family&#039;),
+    array(&#039;font-weight&#039;, &#039;size/height&#039;, &#039;font-family&#039;),
+    array(&#039;font-weight&#039;, &#039;font-size&#039;, &#039;font-family&#039;),
+    array(&#039;font-variant&#039;, &#039;size/height&#039;, &#039;font-family&#039;),
+    array(&#039;font-variant&#039;, &#039;font-size&#039;, &#039;font-family&#039;),
+    array(&#039;font-style&#039;, &#039;size/height&#039;, &#039;font-family&#039;),
+    array(&#039;font-style&#039;, &#039;font-size&#039;, &#039;font-family&#039;),
+    array(&#039;size/height&#039;, &#039;font-family&#039;),
+    array(&#039;font-size&#039;, &#039;font-family&#039;),
+  );
+
+  /**
+   * Stash a reference to the controller &amp; combiner
+   *
+   * @param (class) control: CSSCompression Controller
+   * @param (class) combine: CSSCompression Combiner
+   */
+  public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
+    $this-&gt;Control = $control;
+    $this-&gt;Combine = $combine;
+  }
+
+  /**
+   * Combines multiple font-definitions into single definition
+   *
+   * @param (string) val: Rule Set
+   */
+  public function combine( $val ) {
+    $storage = $this-&gt;storage( $val );
+
+    // Loop through each property check and see if they can be replaced
+    foreach ( $this-&gt;groupings as $props ) {
+      if ( $replace = $this-&gt;Combine-&gt;searchDefinitions( &#039;font&#039;, $storage, $props ) ) {
+        break;
+      }
+    }
+
+    // If replacement string found, run it on all declarations
+    if ( $replace ) {
+      $pos = 0;
+      while ( preg_match( $this-&gt;rfont, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+        if ( ! isset( $storage[&#039;line-height&#039;] ) &amp;&amp; stripos( $match[0][0], &#039;line-height&#039;) === 0 ) {
+          $pos = $match[0][1] + strlen( $match[0][0] ) - 1;
+          continue;
+        }
+        $colon = strlen( $match[1][0] );
+        $val = substr_replace( $val, $replace, $match[0][1] + $colon, strlen( $match[0][0] ) - $colon );
+        $pos = $match[0][1] + strlen( $replace ) - $colon - 1;
+        $replace = &#039;&#039;;
+      }
+    }
+
+    // Return converted val
+    return $val;
+  }
+
+  /**
+   * Builds a storage object for iteration
+   *
+   * @param (string) val: Rule Set
+   */
+  private function storage( $val ) {
+    $storage = array();
+
+    // Find all possible occurences and build the replacement
+    $pos = 0;
+    while ( preg_match( $this-&gt;rfont, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      $storage[$match[2][0] . &#039;-&#039; . $match[3][0]] = $match[4][0];
+      $pos = $match[0][1] + strlen( $match[0][0] ) - 1;
+    }
+
+    // Combine font-size &amp; line-height if possible
+    if ( isset( $storage[&#039;font-size&#039;] ) &amp;&amp; isset( $storage[&#039;line-height&#039;] ) ) {
+      $storage[&#039;size/height&#039;] = $storage[&#039;font-size&#039;] . &#039;/&#039; . $storage[&#039;line-height&#039;];
+      unset( $storage[&#039;font-size&#039;], $storage[&#039;line-height&#039;] );
+    }
+
+    return $storage;
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Font Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Combine/List.inc advagg_css_compress/css-compressor-3.x/src/lib/Combine/List.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Combine/List.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Combine/List.inc	2012-03-23 13:02:18.000000000 -0600
@@ -5,98 +5,97 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Combine_List
-{
-	/**
-	 * Combine Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @class Combine: Combine Controller
-	 * @param (regex) rlist: List style matching
-	 * @param (array) groupings: Group of list combinationals
-	 */
-	private $Control;
-	private $Combine;
-	private $rlist = &quot;/(^|(?&lt;!\\\);)list-style-(type|position|image):(.*?)((?&lt;!\\\);|$)/&quot;;
-	private $groupings = array(
-		array( &#039;type&#039;, &#039;position&#039;, &#039;image&#039; ),
-		array( &#039;type&#039;, &#039;position&#039; ),
-		array( &#039;type&#039;, &#039;image&#039; ),
-		array( &#039;position&#039;, &#039;image&#039; ),
-		array( &#039;type&#039; ),
-		array( &#039;position&#039; ),
-		array( &#039;image&#039; ),
-	);
-
-	/**
-	 * Stash a reference to the controller &amp; combiner
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 * @param (class) combine: CSSCompression Combiner
-	 */
-	public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
-		$this-&gt;Control = $control;
-		$this-&gt;Combine = $combine;
-	}
-
-	/**
-	 * Combines multiple list style props into single definition
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	public function combine( $val ) {
-		// If replacement string found, run it on all declarations
-		if ( ( $replace = $this-&gt;replace( $val ) ) !== false ) {
-			$pos = 0;
-			while ( preg_match( $this-&gt;rlist, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-				$colon = strlen( $match[ 1 ][ 0 ] );
-				$val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
-				$pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1;
-				$replace = &#039;&#039;;
-			}
-		}
-
-		// Return converted val
-		return $val;
-	}
-
-	/**
-	 * Build the replacement string for list props
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	private function replace( $val ) {
-		$storage = array();
-		$pos = 0;
-
-		// Find all possible occurences and build the replacement
-		while ( preg_match( $this-&gt;rlist, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			$storage[ $match[ 2 ][ 0 ] ] = $match[ 3 ][ 0 ];
-			$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
-		}
-
-		// Run background checks and get replacement str
-		foreach ( $this-&gt;groupings as $props ) {
-			if ( $replace = $this-&gt;Combine-&gt;searchDefinitions( &#039;list-style&#039;, $storage, $props ) ) {
-				return $replace;
-			}
-		}
-
-		return false;
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in List Class - &quot; . $method );
-		}
-	}
-};
+class CSSCompression_Combine_List {
+  /**
+   * Combine Patterns
+   *
+   * @class Control: Compression Controller
+   * @class Combine: Combine Controller
+   * @param (regex) rlist: List style matching
+   * @param (array) groupings: Group of list combinationals
+   */
+  private $Control;
+  private $Combine;
+  private $rlist = &quot;/(^|(?&lt;!\\\);)list-style-(type|position|image):(.*?)((?&lt;!\\\);|$)/&quot;;
+  private $groupings = array(
+    array(&#039;type&#039;, &#039;position&#039;, &#039;image&#039;),
+    array(&#039;type&#039;, &#039;position&#039;),
+    array(&#039;type&#039;, &#039;image&#039;),
+    array(&#039;position&#039;, &#039;image&#039;),
+    array(&#039;type&#039;),
+    array(&#039;position&#039;),
+    array(&#039;image&#039;),
+  );
+
+  /**
+   * Stash a reference to the controller &amp; combiner
+   *
+   * @param (class) control: CSSCompression Controller
+   * @param (class) combine: CSSCompression Combiner
+   */
+  public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
+    $this-&gt;Control = $control;
+    $this-&gt;Combine = $combine;
+  }
+
+  /**
+   * Combines multiple list style props into single definition
+   *
+   * @param (string) val: Rule Set
+   */
+  public function combine( $val ) {
+    // If replacement string found, run it on all declarations
+    if ( ( $replace = $this-&gt;replace( $val ) ) !== false ) {
+      $pos = 0;
+      while ( preg_match( $this-&gt;rlist, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+        $colon = strlen( $match[1][0] );
+        $val = substr_replace( $val, $replace, $match[0][1] + $colon, strlen( $match[0][0] ) - $colon );
+        $pos = $match[0][1] + strlen( $replace ) - $colon - 1;
+        $replace = &#039;&#039;;
+      }
+    }
+
+    // Return converted val
+    return $val;
+  }
+
+  /**
+   * Build the replacement string for list props
+   *
+   * @param (string) val: Rule Set
+   */
+  private function replace( $val ) {
+    $storage = array();
+    $pos = 0;
+
+    // Find all possible occurences and build the replacement
+    while ( preg_match( $this-&gt;rlist, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      $storage[$match[2][0]] = $match[3][0];
+      $pos = $match[0][1] + strlen( $match[0][0] ) - 1;
+    }
+
+    // Run background checks and get replacement str
+    foreach ( $this-&gt;groupings as $props ) {
+      if ( $replace = $this-&gt;Combine-&gt;searchDefinitions( &#039;list-style&#039;, $storage, $props ) ) {
+        return $replace;
+      }
+    }
+
+    return false;
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in List Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Combine/MarginPadding.inc advagg_css_compress/css-compressor-3.x/src/lib/Combine/MarginPadding.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Combine/MarginPadding.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Combine/MarginPadding.inc	2012-03-23 13:02:19.000000000 -0600
@@ -5,184 +5,183 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Combine_MarginPadding
-{
-	/**
-	 * Combine Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @class Combine: Combine Controller
-	 * @param (regex) rspace: Checks for space without an escape &#039;\&#039; character before it
-	 * @param (regex) rmp: Margin/Padding matching
-	 * @param (regex) rmpbase: Margin/Padding base match
-	 */
-	private $Control;
-	private $Combine;
-	private $rspace = &quot;/(?&lt;!\\\)\s/&quot;;
-	private $rmp = &quot;/(^|(?&lt;!\\\);)(margin|padding)-(top|right|bottom|left):(.*?)((?&lt;!\\\);|$)/&quot;;
-	private $rmpbase = &quot;/(^|(?&lt;!\\\);)(margin|padding):(.*?)((?&lt;!\\\);|$)/&quot;;
-
-	/**
-	 * Stash a reference to the controller &amp; combiner
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 * @param (class) combine: CSSCompression Combiner
-	 */
-	public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
-		$this-&gt;Control = $control;
-		$this-&gt;Combine = $combine;
-	}
-
-	/**
-	 * Combines multiple directional properties of
-	 * margin/padding into single definition.
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	public function combine( $val ) {
-		$val = $this-&gt;expand( $val );
-		$storage = $this-&gt;storage( $val );
-		$pos = 0;
-
-		// Now rebuild the string replacing all instances of margin/padding if shorthand exists
-		while ( preg_match( $this-&gt;rmp, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			$prop = $match[ 2 ][ 0 ];
-			if ( isset( $storage[ $prop ] ) ) {
-				$colon = strlen( $match[ 1 ][ 0 ] );
-				$val = substr_replace( $val, $storage[ $prop ], $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
-				$pos = $match[ 0 ][ 1 ] + strlen( $storage[ $prop ] ) - $colon - 1;
-				$storage[ $prop ] = &#039;&#039;;
-			}
-			else {
-				$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
-			}
-		}
-
-		// Return converted val
-		return $val;
-	}
-
-	/**
-	 * Build the storage object for iteration
-	 *
-	 * @param (string) val: Rule Set
-	 */
-	private function storage( $val ) {
-		$storage = array();
-		$pos = 0;
-
-		// Find all possible occurences of margin/padding and mark their directional value
-		while ( preg_match( $this-&gt;rmp, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			if ( ! isset( $storage[ $match[ 2 ][ 0 ] ] ) ) {
-				$storage[ $match[ 2 ][ 0 ] ] = array( $match[ 3 ][ 0 ] =&gt; $match[ 4 ][ 0 ] );
-			}
-
-			// Override double written properties
-			$storage[ $match[ 2 ][ 0 ] ][ $match[ 3 ][ 0 ] ] = $match[ 4 ][ 0 ];
-			$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] ) - 1;
-		}
-
-		// Go through each tag for possible combination
-		foreach ( $storage as $tag =&gt; $arr ) {
-			// Only combine if all 4 definitions are found
-			if ( count( $arr ) == 4 &amp;&amp; ! $this-&gt;Combine-&gt;checkUncombinables( $arr ) ) {
-				// All 4 are the same
-				if ( $arr[&#039;top&#039;] == $arr[&#039;bottom&#039;] &amp;&amp; $arr[&#039;left&#039;] == $arr[&#039;right&#039;] &amp;&amp; $arr[&#039;top&#039;] == $arr[&#039;left&#039;] ) {
-					$storage[ $tag ] = &quot;$tag:&quot; . $arr[&#039;top&#039;] . &#039;;&#039;;
-				}
-				// Opposites are the same
-				else if ( $arr[&#039;top&#039;] == $arr[&#039;bottom&#039;] &amp;&amp; $arr[&#039;left&#039;] == $arr[&#039;right&#039;] ) {
-					$storage[ $tag ] = &quot;$tag:&quot; . $arr[&#039;top&#039;] . &#039; &#039; . $arr[&#039;left&#039;] . &#039;;&#039;;
-				}
-				// 3-point directional
-				else if ( $arr[&#039;right&#039;] == $arr[&#039;left&#039;] ) {
-					$storage[ $tag ] = &quot;$tag:&quot; . $arr[&#039;top&#039;] . &#039; &#039; . $arr[&#039;right&#039;] . &#039; &#039; . $arr[&#039;bottom&#039;] . &#039;;&#039;;
-				}
-				// none are the same, but can still use shorthand notation
-				else {
-					$storage[ $tag ] = &quot;$tag:&quot; . $arr[&#039;top&#039;] . &#039; &#039; . $arr[&#039;right&#039;] . &#039; &#039; . $arr[&#039;bottom&#039;] . &#039; &#039; . $arr[&#039;left&#039;] . &#039;;&#039;;
-				}
-			}
-			else {
-				unset( $storage[ $tag ] );
-			}
-		}
-
-		return $storage;
-	}
-
-	/**
-	 * Explodes shorthanded margin/padding properties for later combination
-	 *
-	 * @param (string) val: Rule set
-	 */
-	private function expand( $val ) {
-		$pos = 0;
-		while ( preg_match( $this-&gt;rmpbase, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			$replace = &#039;&#039;;
-			$prop = $match[ 2 ][ 0 ];
-			$value = preg_split( $this-&gt;rspace, trim( $match[ 3 ][ 0 ] ) );
-			$positions = array(
-				&#039;top&#039; =&gt; 0,
-				&#039;right&#039; =&gt; 0,
-				&#039;bottom&#039; =&gt; 0,
-				&#039;left&#039; =&gt; 0
-			);
-
-			// Skip uncombinables
-			if ( $this-&gt;Combine-&gt;checkUncombinables( $value ) ) {
-				$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] );
-				continue;
-			}
-
-			// Each position needs a value
-			switch ( count( $value ) ) {
-				case 1:
-					$positions[&#039;top&#039;] = $positions[&#039;right&#039;] = $positions[&#039;bottom&#039;] = $positions[&#039;left&#039;] = $value[ 0 ];
-					break;
-				case 2:
-					$positions[&#039;top&#039;] = $positions[&#039;bottom&#039;] = $value[ 0 ];
-					$positions[&#039;right&#039;] = $positions[&#039;left&#039;] = $value[ 1 ];
-					break;
-				case 3:
-					$positions[&#039;top&#039;] = $value[ 0 ];
-					$positions[&#039;right&#039;] = $positions[&#039;left&#039;] = $value[ 1 ];
-					$positions[&#039;bottom&#039;] = $value[ 2 ];
-					break;
-				case 4:
-					$positions[&#039;top&#039;] = $value[ 0 ];
-					$positions[&#039;right&#039;] = $value[ 1 ];
-					$positions[&#039;bottom&#039;] = $value[ 2 ];
-					$positions[&#039;left&#039;] = $value[ 3 ];
-					break;
-				default:
-					continue;
-			}
-
-			// Build the replacement
-			foreach ( $positions as $p =&gt; $v ) {
-				$replace .= &quot;$prop-$p:$v;&quot;;
-			}
-			$colon = strlen( $match[ 1 ][ 0 ] );
-			$val = substr_replace( $val, $replace, $match[ 0 ][ 1 ] + $colon, strlen( $match[ 0 ][ 0 ] ) - $colon );
-			$pos = $match[ 0 ][ 1 ] + strlen( $replace ) - $colon - 1;
-		}
-
-		return $val;
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in MarginPadding Class - &quot; . $method );
-		}
-	}
-};
+class CSSCompression_Combine_MarginPadding {
+  /**
+   * Combine Patterns
+   *
+   * @class Control: Compression Controller
+   * @class Combine: Combine Controller
+   * @param (regex) rspace: Checks for space without an escape &#039;\&#039; character before it
+   * @param (regex) rmp: Margin/Padding matching
+   * @param (regex) rmpbase: Margin/Padding base match
+   */
+  private $Control;
+  private $Combine;
+  private $rspace = &quot;/(?&lt;!\\\)\s/&quot;;
+  private $rmp = &quot;/(^|(?&lt;!\\\);)(margin|padding)-(top|right|bottom|left):(.*?)((?&lt;!\\\);|$)/&quot;;
+  private $rmpbase = &quot;/(^|(?&lt;!\\\);)(margin|padding):(.*?)((?&lt;!\\\);|$)/&quot;;
+
+  /**
+   * Stash a reference to the controller &amp; combiner
+   *
+   * @param (class) control: CSSCompression Controller
+   * @param (class) combine: CSSCompression Combiner
+   */
+  public function __construct( CSSCompression_Control $control, CSSCompression_Combine $combine ) {
+    $this-&gt;Control = $control;
+    $this-&gt;Combine = $combine;
+  }
+
+  /**
+   * Combines multiple directional properties of
+   * margin/padding into single definition.
+   *
+   * @param (string) val: Rule Set
+   */
+  public function combine( $val ) {
+    $val = $this-&gt;expand( $val );
+    $storage = $this-&gt;storage( $val );
+    $pos = 0;
+
+    // Now rebuild the string replacing all instances of margin/padding if shorthand exists
+    while ( preg_match( $this-&gt;rmp, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      $prop = $match[2][0];
+      if ( isset( $storage[$prop] ) ) {
+        $colon = strlen( $match[1][0] );
+        $val = substr_replace( $val, $storage[$prop], $match[0][1] + $colon, strlen( $match[0][0] ) - $colon );
+        $pos = $match[0][1] + strlen( $storage[$prop] ) - $colon - 1;
+        $storage[$prop] = &#039;&#039;;
+      }
+      else {
+        $pos = $match[0][1] + strlen( $match[0][0] ) - 1;
+      }
+    }
+
+    // Return converted val
+    return $val;
+  }
+
+  /**
+   * Build the storage object for iteration
+   *
+   * @param (string) val: Rule Set
+   */
+  private function storage( $val ) {
+    $storage = array();
+    $pos = 0;
+
+    // Find all possible occurences of margin/padding and mark their directional value
+    while ( preg_match( $this-&gt;rmp, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      if ( ! isset( $storage[$match[2][0]] ) ) {
+        $storage[$match[2][0]] = array($match[3][0] =&gt; $match[4][0]);
+      }
+
+      // Override double written properties
+      $storage[$match[2][0]][$match[3][0]] = $match[4][0];
+      $pos = $match[0][1] + strlen( $match[0][0] ) - 1;
+    }
+
+    // Go through each tag for possible combination
+    foreach ( $storage as $tag =&gt; $arr ) {
+      // Only combine if all 4 definitions are found
+      if ( count( $arr ) == 4 &amp;&amp; ! $this-&gt;Combine-&gt;checkUncombinables( $arr ) ) {
+        // All 4 are the same
+        if ( $arr[&#039;top&#039;] == $arr[&#039;bottom&#039;] &amp;&amp; $arr[&#039;left&#039;] == $arr[&#039;right&#039;] &amp;&amp; $arr[&#039;top&#039;] == $arr[&#039;left&#039;] ) {
+          $storage[$tag] = &quot;$tag:&quot; . $arr[&#039;top&#039;] . &#039;;&#039;;
+        }
+        // Opposites are the same
+        else if ( $arr[&#039;top&#039;] == $arr[&#039;bottom&#039;] &amp;&amp; $arr[&#039;left&#039;] == $arr[&#039;right&#039;] ) {
+          $storage[$tag] = &quot;$tag:&quot; . $arr[&#039;top&#039;] . &#039; &#039; . $arr[&#039;left&#039;] . &#039;;&#039;;
+        }
+        // 3-point directional
+        else if ( $arr[&#039;right&#039;] == $arr[&#039;left&#039;] ) {
+          $storage[$tag] = &quot;$tag:&quot; . $arr[&#039;top&#039;] . &#039; &#039; . $arr[&#039;right&#039;] . &#039; &#039; . $arr[&#039;bottom&#039;] . &#039;;&#039;;
+        }
+        // none are the same, but can still use shorthand notation
+        else {
+          $storage[$tag] = &quot;$tag:&quot; . $arr[&#039;top&#039;] . &#039; &#039; . $arr[&#039;right&#039;] . &#039; &#039; . $arr[&#039;bottom&#039;] . &#039; &#039; . $arr[&#039;left&#039;] . &#039;;&#039;;
+        }
+      }
+      else {
+        unset( $storage[$tag] );
+      }
+    }
+
+    return $storage;
+  }
+
+  /**
+   * Explodes shorthanded margin/padding properties for later combination
+   *
+   * @param (string) val: Rule set
+   */
+  private function expand( $val ) {
+    $pos = 0;
+    while ( preg_match( $this-&gt;rmpbase, $val, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      $replace = &#039;&#039;;
+      $prop = $match[2][0];
+      $value = preg_split( $this-&gt;rspace, trim( $match[3][0] ) );
+      $positions = array(
+        &#039;top&#039; =&gt; 0,
+        &#039;right&#039; =&gt; 0,
+        &#039;bottom&#039; =&gt; 0,
+        &#039;left&#039; =&gt; 0,
+      );
+
+      // Skip uncombinables
+      if ( $this-&gt;Combine-&gt;checkUncombinables( $value ) ) {
+        $pos = $match[0][1] + strlen( $match[0][0] );
+        continue;
+      }
+
+      // Each position needs a value
+      switch ( count( $value ) ) {
+        case 1:
+          $positions[&#039;top&#039;] = $positions[&#039;right&#039;] = $positions[&#039;bottom&#039;] = $positions[&#039;left&#039;] = $value[0];
+          break;
+        case 2:
+          $positions[&#039;top&#039;] = $positions[&#039;bottom&#039;] = $value[0];
+          $positions[&#039;right&#039;] = $positions[&#039;left&#039;] = $value[1];
+          break;
+        case 3:
+          $positions[&#039;top&#039;] = $value[0];
+          $positions[&#039;right&#039;] = $positions[&#039;left&#039;] = $value[1];
+          $positions[&#039;bottom&#039;] = $value[2];
+          break;
+        case 4:
+          $positions[&#039;top&#039;] = $value[0];
+          $positions[&#039;right&#039;] = $value[1];
+          $positions[&#039;bottom&#039;] = $value[2];
+          $positions[&#039;left&#039;] = $value[3];
+          break;
+        default:
+          continue;
+      }
+
+      // Build the replacement
+      foreach ( $positions as $p =&gt; $v ) {
+        $replace .= &quot;$prop-$p:$v;&quot;;
+      }
+      $colon = strlen( $match[1][0] );
+      $val = substr_replace( $val, $replace, $match[0][1] + $colon, strlen( $match[0][0] ) - $colon );
+      $pos = $match[0][1] + strlen( $replace ) - $colon - 1;
+    }
+
+    return $val;
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in MarginPadding Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Combine.inc advagg_css_compress/css-compressor-3.x/src/lib/Combine.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Combine.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Combine.inc	2012-03-23 13:02:19.000000000 -0600
@@ -5,185 +5,184 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Combine
-{
-	/**
-	 * Combine Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @param (string) token: Copy of the injection token
-	 * @param (array) options: Reference to options
-	 * @param (regex) rspace: Checks for space without an escape &#039;\&#039; character before it
-	 * @param (regex) rslash: Checks for unescaped slash character
-	 * @param (regex) rimportant: Checking props for uncombinables
-	 * @param (array) methods: List of options with their corresponding class
-	 */
-	private $Control;
-	private $token = &#039;&#039;;
-	private $options = array();
-	private $rspace = &quot;/(?&lt;!\\\)\s/&quot;;
-	private $rslash = &quot;/(?&lt;!\\\)\//&quot;;
-	private $rimportant = &quot;/inherit|\!important|\!ie|(?&lt;!\\\)\s/i&quot;;
-	private $methods = array(
-		&#039;csw-combine&#039; =&gt; &#039;BorderOutline&#039;,
-		&#039;border-radius-combine&#039; =&gt; &#039;BorderRadius&#039;,
-		&#039;border-combine&#039; =&gt; &#039;Border&#039;,
-		&#039;mp-combine&#039; =&gt; &#039;MarginPadding&#039;,
-		&#039;background-combine&#039; =&gt; &#039;Background&#039;,
-		&#039;auralcp-combine&#039; =&gt; &#039;Aural&#039;,
-		&#039;font-combine&#039; =&gt; &#039;Font&#039;,
-		&#039;list-combine&#039; =&gt; &#039;List&#039;,
-	);
-
-	/**
-	 * Sub Comination Classes
-	 *
-	 * @class BorderOutline: Handles Color/Style/With combinations of border/outline properties
-	 * @class BorderRadius: Handles border-radius combinations
-	 * @class Border: Handles normal border combinations
-	 * @class MarginPadding: Handles margin/padding combinations
-	 * @class Background: Handles background combinations
-	 * @class Aural: Handles aural combinations
-	 * @class Font: Handles font combinations
-	 * @class List: Handles list combinations
-	 * @param (array) subcombines: Array holding all subcombination classes
-	 */
-	public $BorderOutline;
-	public $BorderRadius;
-	public $Border;
-	public $MarginPadding;
-	public $Background;
-	public $Aural;
-	public $Font;
-	public $List;
-	private $subcombines = array(
-		&#039;BorderOutline&#039;,
-		&#039;BorderRadius&#039;,
-		&#039;Border&#039;,
-		&#039;MarginPadding&#039;,
-		&#039;Background&#039;,
-		&#039;Aural&#039;,
-		&#039;Font&#039;,
-		&#039;List&#039;,
-	);
-
-	/**
-	 * Stash a reference to the controller on each instantiation
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 */
-	public function __construct( CSSCompression_Control $control ) {
-		$this-&gt;Control = $control;
-		$this-&gt;token = CSSCompression::TOKEN;
-		$this-&gt;options = &amp;$control-&gt;Option-&gt;options;
-
-		// Include classes if not already done so
-		if ( ! class_exists( &quot;CSSCompression_Combine_Border&quot;, false ) ) {
-			$path = dirname(__FILE__) . &#039;/Combine/&#039;;
-			foreach ( $this-&gt;subcombines as $class ) {
-				require( $path . $class . &#039;.inc&#039; );
-			}
-		}
-
-		// Instantiate each sub combine
-		foreach ( $this-&gt;subcombines as $class ) {
-			$full = &quot;CSSCompression_Combine_$class&quot;;
-			$this-&gt;$class = new $full( $control, $this );
-		}
-	}
-
-	/**
-	 * Reads through each detailed package and checks for cross defn combinations
-	 *
-	 * @param (array) selectors: Array of selectors
-	 * @param (array) details: Array of details
-	 */
-	public function combine( &amp;$selectors = array(), &amp;$details = array() ) {
-		foreach ( $details as $i =&gt; &amp;$value ) {
-			if ( isset( $selectors[ $i ] ) &amp;&amp; strpos( $selectors[ $i ], $this-&gt;token ) === 0 ) {
-				continue;
-			}
-
-			foreach ( $this-&gt;methods as $option =&gt; $class ) {
-				if ( $this-&gt;options[ $option ] ) {
-					$value = $this-&gt;$class-&gt;combine( $value );
-				}
-			}
-		}
-
-		return array( $selectors, $details );
-	}
-
-	/**
-	 * Helper function to ensure flagged words don&#039;t get
-	 * overridden
-	 *
-	 * @param (mixed) obj: Array/String of definitions to be checked
-	 */
-	public function checkUncombinables( $obj ) {
-		if ( is_array( $obj ) ) {
-			foreach ( $obj as $item ) {
-				if ( preg_match( $this-&gt;rimportant, $item ) ) {
-					return true;
-				}
-			}
-			return false;
-		}
-		else {
-			return preg_match( $this-&gt;rimportant, $obj );
-		}
-	}
-
-	/**
-	 * Helper function to ensure all values of search array
-	 * exist within the storage array
-	 *
-	 * @param (string) prop: CSS Property
-	 * @param (array) storage: Array of definitions found
-	 * @param (array) search: Array of definitions requred
-	 */
-	public function searchDefinitions( $prop, $storage, $search ) {
-		// Return if storage &amp; search don&#039;t match
-		if ( count( $storage ) != count( $search ) ) {
-			return false;
-		}
-
-		$str = &quot;$prop:&quot;;
-		foreach ( $search as $value ) {
-			if ( ! isset( $storage[ $value ] ) || $this-&gt;checkUncombinables( $storage[ $value ] ) ) {
-				return false;
-			}
-			$str .= $storage[ $value ] . &#039; &#039;;
-		}
-		return trim( $str ) . &#039;;&#039;;
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) subclass: Name of subclass to focus on
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $subclass, $method, $args ) {
-		if ( $subclass == &#039;Combine&#039; ) {
-			if ( method_exists( $this, $method ) ) {
-				if ( $method == &#039;combine&#039; ) {
-					return $this-&gt;combine( $args[ 0 ], $args[ 1 ] );
-				}
-				else {
-					return call_user_func_array( array( $this, $method ), $args );
-				}
-			}
-			else {
-				throw new CSSCompression_Exception( &quot;Unknown method in Combine Class - &quot; . $method );
-			}
-		}
-		else if ( in_array( $subclass, $this-&gt;subcombines ) ) {
-			return $this-&gt;$subclass-&gt;access( $method, $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown Sub Combine Class - &quot; . $subclass );
-		}
-	}
-};
+class CSSCompression_Combine {
+  /**
+   * Combine Patterns
+   *
+   * @class Control: Compression Controller
+   * @param (string) token: Copy of the injection token
+   * @param (array) options: Reference to options
+   * @param (regex) rspace: Checks for space without an escape &#039;\&#039; character before it
+   * @param (regex) rslash: Checks for unescaped slash character
+   * @param (regex) rimportant: Checking props for uncombinables
+   * @param (array) methods: List of options with their corresponding class
+   */
+  private $Control;
+  private $token = &#039;&#039;;
+  private $options = array();
+  private $rspace = &quot;/(?&lt;!\\\)\s/&quot;;
+  private $rslash = &quot;/(?&lt;!\\\)\//&quot;;
+  private $rimportant = &quot;/inherit|\!important|\!ie|(?&lt;!\\\)\s/i&quot;;
+  private $methods = array(
+    &#039;csw-combine&#039; =&gt; &#039;BorderOutline&#039;,
+    &#039;border-radius-combine&#039; =&gt; &#039;BorderRadius&#039;,
+    &#039;border-combine&#039; =&gt; &#039;Border&#039;,
+    &#039;mp-combine&#039; =&gt; &#039;MarginPadding&#039;,
+    &#039;background-combine&#039; =&gt; &#039;Background&#039;,
+    &#039;auralcp-combine&#039; =&gt; &#039;Aural&#039;,
+    &#039;font-combine&#039; =&gt; &#039;Font&#039;,
+    &#039;list-combine&#039; =&gt; &#039;List&#039;,
+  );
+
+  /**
+   * Sub Comination Classes
+   *
+   * @class BorderOutline: Handles Color/Style/With combinations of border/outline properties
+   * @class BorderRadius: Handles border-radius combinations
+   * @class Border: Handles normal border combinations
+   * @class MarginPadding: Handles margin/padding combinations
+   * @class Background: Handles background combinations
+   * @class Aural: Handles aural combinations
+   * @class Font: Handles font combinations
+   * @class List: Handles list combinations
+   * @param (array) subcombines: Array holding all subcombination classes
+   */
+  public $BorderOutline;
+  public $BorderRadius;
+  public $Border;
+  public $MarginPadding;
+  public $Background;
+  public $Aural;
+  public $Font;
+  public $List;
+  private $subcombines = array(
+    &#039;BorderOutline&#039;,
+    &#039;BorderRadius&#039;,
+    &#039;Border&#039;,
+    &#039;MarginPadding&#039;,
+    &#039;Background&#039;,
+    &#039;Aural&#039;,
+    &#039;Font&#039;,
+    &#039;List&#039;,
+  );
+
+  /**
+   * Stash a reference to the controller on each instantiation
+   *
+   * @param (class) control: CSSCompression Controller
+   */
+  public function __construct( CSSCompression_Control $control ) {
+    $this-&gt;Control = $control;
+    $this-&gt;token = CSSCompression::TOKEN;
+    $this-&gt;options = &amp;$control-&gt;Option-&gt;options;
+
+    // Include classes if not already done so
+    if ( ! class_exists( &quot;CSSCompression_Combine_Border&quot;, false ) ) {
+      $path = dirname(__FILE__) . &#039;/Combine/&#039;;
+      foreach ( $this-&gt;subcombines as $class ) {
+        require( $path . $class . &#039;.inc&#039; );
+      }
+    }
+
+    // Instantiate each sub combine
+    foreach ( $this-&gt;subcombines as $class ) {
+      $full = &quot;CSSCompression_Combine_$class&quot;;
+      $this-&gt;$class = new $full( $control, $this );
+    }
+  }
+
+  /**
+   * Reads through each detailed package and checks for cross defn combinations
+   *
+   * @param (array) selectors: Array of selectors
+   * @param (array) details: Array of details
+   */
+  public function combine( &amp;$selectors = array(), &amp;$details = array() ) {
+    foreach ( $details as $i =&gt; &amp;$value ) {
+      if ( isset( $selectors[$i] ) &amp;&amp; strpos( $selectors[$i], $this-&gt;token ) === 0 ) {
+        continue;
+      }
+
+      foreach ( $this-&gt;methods as $option =&gt; $class ) {
+        if ( $this-&gt;options[$option] ) {
+          $value = $this-&gt;$class-&gt;combine( $value );
+        }
+      }
+    }
+
+    return array($selectors, $details);
+  }
+
+  /**
+   * Helper function to ensure flagged words don&#039;t get
+   * overridden
+   *
+   * @param (mixed) obj: Array/String of definitions to be checked
+   */
+  public function checkUncombinables( $obj ) {
+    if ( is_array( $obj ) ) {
+      foreach ( $obj as $item ) {
+        if ( preg_match( $this-&gt;rimportant, $item ) ) {
+          return true;
+        }
+      }
+      return false;
+    }
+    else {
+      return preg_match( $this-&gt;rimportant, $obj );
+    }
+  }
+
+  /**
+   * Helper function to ensure all values of search array
+   * exist within the storage array
+   *
+   * @param (string) prop: CSS Property
+   * @param (array) storage: Array of definitions found
+   * @param (array) search: Array of definitions requred
+   */
+  public function searchDefinitions( $prop, $storage, $search ) {
+    // Return if storage &amp; search don&#039;t match
+    if ( count( $storage ) != count( $search ) ) {
+      return false;
+    }
+
+    $str = &quot;$prop:&quot;;
+    foreach ( $search as $value ) {
+      if ( ! isset( $storage[$value] ) || $this-&gt;checkUncombinables( $storage[$value] ) ) {
+        return false;
+      }
+      $str .= $storage[$value] . &#039; &#039;;
+    }
+    return trim( $str ) . &#039;;&#039;;
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) subclass: Name of subclass to focus on
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $subclass, $method, $args ) {
+    if ( $subclass == &#039;Combine&#039; ) {
+      if ( method_exists( $this, $method ) ) {
+        if ( $method == &#039;combine&#039; ) {
+          return $this-&gt;combine( $args[0], $args[1] );
+        }
+        else {
+          return call_user_func_array( array($this, $method), $args );
+        }
+      }
+      else {
+        throw new CSSCompression_Exception( &quot;Unknown method in Combine Class - &quot; . $method );
+      }
+    }
+    else if ( in_array( $subclass, $this-&gt;subcombines ) ) {
+      return $this-&gt;$subclass-&gt;access( $method, $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown Sub Combine Class - &quot; . $subclass );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Compress.inc advagg_css_compress/css-compressor-3.x/src/lib/Compress.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Compress.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Compress.inc	2012-03-23 13:02:19.000000000 -0600
@@ -5,206 +5,205 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Compress
-{
-	/**
-	 * Trim Patterns
-	 *
-	 * @param (array) options: Reference to options
-	 * @param (array) stats: Reference to stats
-	 * @param (regex) rsemicolon: Checks for semicolon without an escape &#039;\&#039; character before it
-	 * @param (regex) rcolon: Checks for colon without an escape &#039;\&#039; character before it
-	 * @param (regex) rspace: Checks for space without an escape &#039;\&#039; character before it
-	 */
-	private $options = array();
-	private $stats = array();
-	private $rsemicolon = &quot;/(?&lt;!\\\);/&quot;;
-	private $rcolon = &quot;/(?&lt;!\\\):/&quot;;
-	private $rspace = &quot;/(?&lt;!\\\)\s/&quot;;
-
-	/**
-	 * Other inner classes that get used within compression
-	 *
-	 * @class Control: Compression Controller
-	 * @class Trim: Trim Instance
-	 * @class Setup: Setup Instance
-	 * @class Format: Formatting Instance
-	 * @class Combine: Combine Instance
-	 * @class Cleanup: Cleanup Instance
-	 * @class Organize: Organize Instance
-	 * @class Selectors: Selectors Instance
-	 * @param (array) others: List of above classes for copying
-	 */
-	private $Control;
-	private $Trim;
-	private $Setup;
-	private $Format;
-	private $Combine;
-	private $Cleanup;
-	private $Organize;
-	private $Selectors;
-	private $others = array(
-		&#039;Trim&#039;,
-		&#039;Setup&#039;,
-		&#039;Format&#039;,
-		&#039;Combine&#039;,
-		&#039;Cleanup&#039;,
-		&#039;Organize&#039;,
-		&#039;Selectors&#039;,
-	);
-
-	/**
-	 * Stash a reference to the controller on each instantiation
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 */
-	public function __construct( CSSCompression_Control $control ) {
-		$this-&gt;Control = $control;
-		$this-&gt;options = &amp;$control-&gt;Option-&gt;options;
-		$this-&gt;stats = &amp;$control-&gt;stats;
-
-		foreach ( $this-&gt;others as $class ) {
-			$this-&gt;$class = $control-&gt;$class;
-		}
-	}
-
-	/**
-	 * Centralized function to run css compression.
-	 *
-	 * @param (string) css: Stylesheet to compresss
-	 */
-	public function compress( $css ) {
-		$setup = $this-&gt;setup( $css );
-		$setup = $this-&gt;rulesets( $setup );
-		$css = $this-&gt;readability( $setup );
-
-		// Attach plea to top of page with unknown blocks
-		if ( $this-&gt;options[&#039;add-unknown&#039;] &amp;&amp; count( $setup[&#039;unknown&#039;] ) ) {
-			$css = &quot;/*\nThere are unknown blocks in the sheet, please please please open an issue with your sheet attached to it:\n&quot;
+class CSSCompression_Compress {
+  /**
+   * Trim Patterns
+   *
+   * @param (array) options: Reference to options
+   * @param (array) stats: Reference to stats
+   * @param (regex) rsemicolon: Checks for semicolon without an escape &#039;\&#039; character before it
+   * @param (regex) rcolon: Checks for colon without an escape &#039;\&#039; character before it
+   * @param (regex) rspace: Checks for space without an escape &#039;\&#039; character before it
+   */
+  private $options = array();
+  private $stats = array();
+  private $rsemicolon = &quot;/(?&lt;!\\\);/&quot;;
+  private $rcolon = &quot;/(?&lt;!\\\):/&quot;;
+  private $rspace = &quot;/(?&lt;!\\\)\s/&quot;;
+
+  /**
+   * Other inner classes that get used within compression
+   *
+   * @class Control: Compression Controller
+   * @class Trim: Trim Instance
+   * @class Setup: Setup Instance
+   * @class Format: Formatting Instance
+   * @class Combine: Combine Instance
+   * @class Cleanup: Cleanup Instance
+   * @class Organize: Organize Instance
+   * @class Selectors: Selectors Instance
+   * @param (array) others: List of above classes for copying
+   */
+  private $Control;
+  private $Trim;
+  private $Setup;
+  private $Format;
+  private $Combine;
+  private $Cleanup;
+  private $Organize;
+  private $Selectors;
+  private $others = array(
+    &#039;Trim&#039;,
+    &#039;Setup&#039;,
+    &#039;Format&#039;,
+    &#039;Combine&#039;,
+    &#039;Cleanup&#039;,
+    &#039;Organize&#039;,
+    &#039;Selectors&#039;,
+  );
+
+  /**
+   * Stash a reference to the controller on each instantiation
+   *
+   * @param (class) control: CSSCompression Controller
+   */
+  public function __construct( CSSCompression_Control $control ) {
+    $this-&gt;Control = $control;
+    $this-&gt;options = &amp;$control-&gt;Option-&gt;options;
+    $this-&gt;stats = &amp;$control-&gt;stats;
+
+    foreach ( $this-&gt;others as $class ) {
+      $this-&gt;$class = $control-&gt;$class;
+    }
+  }
+
+  /**
+   * Centralized function to run css compression.
+   *
+   * @param (string) css: Stylesheet to compresss
+   */
+  public function compress( $css ) {
+    $setup = $this-&gt;setup( $css );
+    $setup = $this-&gt;rulesets( $setup );
+    $css = $this-&gt;readability( $setup );
+
+    // Attach plea to top of page with unknown blocks
+    if ( $this-&gt;options[&#039;add-unknown&#039;] &amp;&amp; count( $setup[&#039;unknown&#039;] ) ) {
+      $css = &quot;/*\nThere are unknown blocks in the sheet, please please please open an issue with your sheet attached to it:\n&quot;
 				. &quot;https://github.com/codenothing/css-compressor/issues\n&quot;
 				. &quot;Thank You --\n\n&quot;
 				. implode( &quot;\n&quot;, $setup[&#039;unknown&#039;] )
 				. &quot;\n*/\n&quot;
 				. $css;
-		}
+    }
 
-		// Mark final file size
-		$this-&gt;stats[&#039;after&#039;][&#039;size&#039;] = strlen( $css = trim( $css ) );
+    // Mark final file size
+    $this-&gt;stats[&#039;after&#039;][&#039;size&#039;] = strlen( $css = trim( $css ) );
 
-		// Return compressed css
-		return $css;
-	}
-
-	/**
-	 * Runs css through initial setup handlers
-	 *
-	 * @param (string) css: Sheet to compress
-	 */
-	private function setup( $css ) {
-		// Initial stats
-		$this-&gt;stats[&#039;before&#039;][&#039;time&#039;] = microtime( true );
-		$this-&gt;stats[&#039;before&#039;][&#039;size&#039;] = strlen( $css );
-
-		// Initial trimming
-		$css = $this-&gt;Trim-&gt;trim( $css );
-
-		// Do a little tokenizing, compress each property individually
-		$setup = $this-&gt;Setup-&gt;setup( $css );
-
-		// Mark number of selectors pre-combine
-		$this-&gt;stats[&#039;before&#039;][&#039;selectors&#039;] = count( $setup[&#039;selectors&#039;] );
-
-		return $setup;
-	}
-
-	/**
-	 * Focus compressions on each rule set
-	 *
-	 * @param (array) setup: Array containing selectors and rule sets
-	 */
-	private function rulesets( $setup ) {
-		// Do selector specific compressions
-		$this-&gt;Selectors-&gt;selectors( $setup[&#039;selectors&#039;] );
-
-		// Look at each group of properties as a whole, and compress/combine similiar definitions
-		$this-&gt;Combine-&gt;combine( $setup[&#039;selectors&#039;], $setup[&#039;details&#039;] );
-
-		// If order isn&#039;t important, run comination functions before and after compressions to catch all instances
-		// Be sure to prune before hand for higher chance of matching
-		if ( $this-&gt;options[&#039;organize&#039;] ) {
-			$this-&gt;Cleanup-&gt;cleanup( $setup[&#039;selectors&#039;], $setup[&#039;details&#039;] );
-			$this-&gt;Organize-&gt;organize( $setup[&#039;selectors&#039;], $setup[&#039;details&#039;] );
-			$this-&gt;Combine-&gt;combine( $setup[&#039;selectors&#039;], $setup[&#039;details&#039;] );
-		}
-
-		// Do final maintenace work, remove injected property/values
-		$this-&gt;Cleanup-&gt;cleanup( $setup[&#039;selectors&#039;], $setup[&#039;details&#039;] );
-
-		// Run final counters before full cleanup
-		$this-&gt;finalCount( $setup[&#039;selectors&#039;], $setup[&#039;details&#039;] );
-
-		return $setup;
-	}
-
-	/**
-	 * Runs final counts on selectors and props
-	 *
-	 * @param (array) selectors: Selector rules
-	 * @param (array) details: Rule sets
-	 */
-	private function finalCount( $selectors, $details ) {
-		// Selectors and props
-		$this-&gt;stats[&#039;after&#039;][&#039;selectors&#039;] = count( $selectors );
-		foreach ( $details as $item ) {
-			$props = preg_split( $this-&gt;rsemicolon, $item );
-
-			// Make sure count is true
-			foreach ( $props as $k =&gt; $v ) {
-				if ( ! isset( $v ) || $v == &#039;&#039; ) {
-					unset( $props[ $k ] );
-				}
-			}
-			$this-&gt;stats[&#039;after&#039;][&#039;props&#039;] += count( $props );
-		}
-
-		// Final count for stats
-		$this-&gt;stats[&#039;after&#039;][&#039;time&#039;] = microtime( true );
-	}
-
-	/**
-	 * Formats the compressed rule sets into a stylesheet
-	 *
-	 * @param (array) setup: Array containing selectors and rule sets
-	 */
-	private function readability( $setup ) {
-		// Format css to users preference
-		$css = $this-&gt;Format-&gt;readability( $this-&gt;options[&#039;readability&#039;], $setup[&#039;selectors&#039;], $setup[&#039;details&#039;] );
-
-		// Intros
-		foreach ( $setup as $value ) {
-			if ( $value &amp;&amp; is_string( $value ) ) {
-				$css = $value . $css;
-			}
-		}
-
-		// Remove escapables
-		$css = $this-&gt;Cleanup-&gt;removeInjections( $css );
-
-		return $css;
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Compress Class - &quot; . $method );
-		}
-	}
-};
+    // Return compressed css
+    return $css;
+  }
+
+  /**
+   * Runs css through initial setup handlers
+   *
+   * @param (string) css: Sheet to compress
+   */
+  private function setup( $css ) {
+    // Initial stats
+    $this-&gt;stats[&#039;before&#039;][&#039;time&#039;] = microtime( true );
+    $this-&gt;stats[&#039;before&#039;][&#039;size&#039;] = strlen( $css );
+
+    // Initial trimming
+    $css = $this-&gt;Trim-&gt;trim( $css );
+
+    // Do a little tokenizing, compress each property individually
+    $setup = $this-&gt;Setup-&gt;setup( $css );
+
+    // Mark number of selectors pre-combine
+    $this-&gt;stats[&#039;before&#039;][&#039;selectors&#039;] = count( $setup[&#039;selectors&#039;] );
+
+    return $setup;
+  }
+
+  /**
+   * Focus compressions on each rule set
+   *
+   * @param (array) setup: Array containing selectors and rule sets
+   */
+  private function rulesets( $setup ) {
+    // Do selector specific compressions
+    $this-&gt;Selectors-&gt;selectors( $setup[&#039;selectors&#039;] );
+
+    // Look at each group of properties as a whole, and compress/combine similiar definitions
+    $this-&gt;Combine-&gt;combine( $setup[&#039;selectors&#039;], $setup[&#039;details&#039;] );
+
+    // If order isn&#039;t important, run comination functions before and after compressions to catch all instances
+    // Be sure to prune before hand for higher chance of matching
+    if ( $this-&gt;options[&#039;organize&#039;] ) {
+      $this-&gt;Cleanup-&gt;cleanup( $setup[&#039;selectors&#039;], $setup[&#039;details&#039;] );
+      $this-&gt;Organize-&gt;organize( $setup[&#039;selectors&#039;], $setup[&#039;details&#039;] );
+      $this-&gt;Combine-&gt;combine( $setup[&#039;selectors&#039;], $setup[&#039;details&#039;] );
+    }
+
+    // Do final maintenace work, remove injected property/values
+    $this-&gt;Cleanup-&gt;cleanup( $setup[&#039;selectors&#039;], $setup[&#039;details&#039;] );
+
+    // Run final counters before full cleanup
+    $this-&gt;finalCount( $setup[&#039;selectors&#039;], $setup[&#039;details&#039;] );
+
+    return $setup;
+  }
+
+  /**
+   * Runs final counts on selectors and props
+   *
+   * @param (array) selectors: Selector rules
+   * @param (array) details: Rule sets
+   */
+  private function finalCount( $selectors, $details ) {
+    // Selectors and props
+    $this-&gt;stats[&#039;after&#039;][&#039;selectors&#039;] = count( $selectors );
+    foreach ( $details as $item ) {
+      $props = preg_split( $this-&gt;rsemicolon, $item );
+
+      // Make sure count is true
+      foreach ( $props as $k =&gt; $v ) {
+        if ( ! isset( $v ) || $v == &#039;&#039; ) {
+          unset( $props[$k] );
+        }
+      }
+      $this-&gt;stats[&#039;after&#039;][&#039;props&#039;] += count( $props );
+    }
+
+    // Final count for stats
+    $this-&gt;stats[&#039;after&#039;][&#039;time&#039;] = microtime( true );
+  }
+
+  /**
+   * Formats the compressed rule sets into a stylesheet
+   *
+   * @param (array) setup: Array containing selectors and rule sets
+   */
+  private function readability( $setup ) {
+    // Format css to users preference
+    $css = $this-&gt;Format-&gt;readability( $this-&gt;options[&#039;readability&#039;], $setup[&#039;selectors&#039;], $setup[&#039;details&#039;] );
+
+    // Intros
+    foreach ( $setup as $value ) {
+      if ( $value &amp;&amp; is_string( $value ) ) {
+        $css = $value . $css;
+      }
+    }
+
+    // Remove escapables
+    $css = $this-&gt;Cleanup-&gt;removeInjections( $css );
+
+    return $css;
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Compress Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Control.inc advagg_css_compress/css-compressor-3.x/src/lib/Control.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Control.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Control.inc	2012-03-23 13:02:19.000000000 -0600
@@ -5,230 +5,229 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Control
-{
-	/**
-	 * Control Patterns
-	 *
-	 * @param (string) css: Holds compressed css string
-	 * @param (string) mode: Current compression mode state
-	 * @param (array) stats: Holds compression stats
-	 * @param (array) getters: Array of accessible getters
-	 */
-	public $css = &#039;&#039;;
-	public $mode = &#039;&#039;;
-	public $stats = array();
-	private $getters = array(
-		&#039;css&#039;,
-		&#039;mode&#039;,
-		&#039;stats&#039;,
-	);
-
-	/**
-	 * Subclasses that do the ground work for this compressor
-	 *
-	 * @class CSSCompression: Public facing compression class
-	 * @class Option: Option handling
-	 * @class Trim: Does the initial trimming for the css
-	 * @class Format: Formats the output
-	 * @class Numeric: Handles numeric compression
-	 * @class Color: Handles color compression
-	 * @class Individuals: Runs compression algorithms on individual properties and values
-	 * @class Selectors: Runs selector specific compressions
-	 * @class Combine: Handles combining of various properties
-	 * @class Organize: Reorganizes the sheet for futher compression
-	 * @class Cleanup: Cleans out all injected characters during compression
-	 * @class Compress: Central compression unit.
-	 * @param (array) subclasses: Array holding all the subclasses for inlusion
-	 */
-	public $CSSCompression;
-	public $Option;
-	public $Trim;
-	public $Format;
-	public $Numeric;
-	public $Color;
-	public $Individuals;
-	public $Selectors;
-	public $Combine;
-	public $Organize;
-	public $Cleanup;
-	public $Setup;
-	public $Compress;
-	private $subclasses = array(
-		&#039;Option&#039;,
-		&#039;Trim&#039;,
-		&#039;Format&#039;,
-		&#039;Numeric&#039;,
-		&#039;Color&#039;,
-		&#039;Individuals&#039;,
-		&#039;Selectors&#039;,
-		&#039;Combine&#039;,
-		&#039;Organize&#039;,
-		&#039;Cleanup&#039;,
-		&#039;Setup&#039;,
-		&#039;Compress&#039;,
-	);
-
-	/**
-	 * Pull in the Compression instance and build the subclasses
-	 *
-	 * @param (class) CSSCompression: CSSCompression Instance
-	 */
-	public function __construct( CSSCompression $CSSCompression ) {
-		$this-&gt;CSSCompression = $CSSCompression;
-
-		// Load all subclasses on demand
-		if ( ! class_exists( &quot;CSSCompression_Option&quot;, false ) ) {
-			$path = dirname(__FILE__) . &#039;/&#039;;
-			foreach ( $this-&gt;subclasses as $class ) {
-				require( $path . $class . &#039;.inc&#039; );
-			}
-		}
-
-		// Initialize each subclass
-		foreach ( $this-&gt;subclasses as $class ) {
-			$full = &quot;CSSCompression_$class&quot;;
-			$this-&gt;$class = new $full( $this );
-		}
-	}
-
-	/**
-	 * Control access to properties
-	 *
-	 *	- Getting stats/mode/css returns the current value of that property
-	 *	- Getting options will return the current full options array
-	 *	- Getting anything else returns that current value in the options array or NULL
-	 *
-	 * @param (string) name: Name of property that you want to access
-	 */
-	public function get( $name ) {
-		if ( in_array( $name, $this-&gt;getters ) ) {
-			return $this-&gt;$name;
-		}
-		else if ( $name == &#039;options&#039; ) {
-			return $this-&gt;Option-&gt;options;
-		}
-		else {
-			return $this-&gt;Option-&gt;option( $name );
-		}
-	}
-
-	/**
-	 * The setter method only allows access to setting values in the options array
-	 *
-	 * @param (string) name: Key name of the option you want to set
-	 * @param (mixed) value: Value of the option you want to set
-	 */
-	public function set( $name, $value ) {
-		// Allow for passing array of options to merge into current ones
-		if ( $name === &#039;options&#039; &amp;&amp; is_array( $value ) ) {
-			return $this-&gt;Option-&gt;merge( $value );
-		}
-		else if ( isset( CSSCompression::$defaults[ $name ] ) ) {
-			return $this-&gt;Option-&gt;option( $name, $value );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Invalid Private Access to $name in CSSCompression.&quot; );
-		}
-	}
-
-	/**
-	 * Merges a predefined set options
-	 *
-	 * @param (string) mode: Name of mode to use.
-	 */
-	public function mode( $mode = NULL ) {
-		return $this-&gt;Options-&gt;merge( $mode );
-	}
-
-	/**
-	 * Resets options to their defaults, and flushes out variables
-	 *
-	 * @params none
-	 */
-	public function reset(){
-		$this-&gt;Option-&gt;reset();
-		return $this-&gt;flush();
-	}
-
-	/**
-	 * Cleans out class variables for next run
-	 *
-	 * @params none
-	 */
-	public function flush(){
-		$this-&gt;css = &#039;&#039;;
-		$this-&gt;stats = array(
-			&#039;before&#039; =&gt; array(
-				&#039;props&#039; =&gt; 0,
-				&#039;selectors&#039; =&gt; 0,
-				&#039;size&#039; =&gt; 0,
-				&#039;time&#039; =&gt; 0,
-			),
-			&#039;after&#039; =&gt; array(
-				&#039;props&#039; =&gt; 0,
-				&#039;selectors&#039; =&gt; 0,
-				&#039;size&#039; =&gt; 0,
-				&#039;time&#039; =&gt; 0,
-			),
-		);
-
-		return true;
-	}
-
-	/**
-	 * Proxy to run Compression on the sheet passed. Handle options here.
-	 *
-	 * @param (string) css: Stylesheet to be compressed
-	 * @param (mixed) options: Array of options or mode to use.
-	 */
-	public function compress( $css = NULL, $options = NULL ) {
-		// Flush out old stats and variables
-		$this-&gt;flush();
-
-		// If no additional options, just run compression
-		if ( $options === NULL ) {
-			return $this-&gt;css = $this-&gt;Compress-&gt;compress( $css );
-		}
-
-		// Store old params
-		$old = $this-&gt;mode == &#039;__custom&#039; ? $this-&gt;Option-&gt;option() : $this-&gt;mode;
-		$readability = $this-&gt;Option-&gt;option( &#039;readability&#039; );
-
-		// Compress with new set of options
-		$this-&gt;Option-&gt;merge( $options );
-		$css = $this-&gt;Compress-&gt;compress( $css );
-
-		// Reset original options
-		$this-&gt;reset();
-		$this-&gt;Option-&gt;merge( $old );
-
-		// Return the compressed css
-		return $this-&gt;css = $css;
-	}
-
-	/**
-	 * Backdoor access to subclasses
-	 * ONLY FOR DEVELOPMENT/TESTING.
-	 *
-	 * @param (string) class: Name of the focus class
-	 * @param (array) config: Contains name reference and test arguments
-	 */
-	public function access( $class, $method, $args ) {
-		if ( $class == &#039;Control&#039; ) {
-			return call_user_func_array( array( $class, $method ), $args );
-		}
-		else if ( strpos( $class, &#039;.&#039; ) !== false ) {
-			$parts = explode( &#039;.&#039;, $class );
-			$class = $parts[ 0 ];
-			$subclass = $parts[ 1 ];
-			return $this-&gt;$class-&gt;access( $subclass, $method, $args );
-		}
-		else if ( in_array( $class, $this-&gt;subclasses ) ) {
-			return $this-&gt;$class-&gt;access( $method, $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown Class Access - &quot; . $class );
-		}
-	}
-};
+class CSSCompression_Control {
+  /**
+   * Control Patterns
+   *
+   * @param (string) css: Holds compressed css string
+   * @param (string) mode: Current compression mode state
+   * @param (array) stats: Holds compression stats
+   * @param (array) getters: Array of accessible getters
+   */
+  public $css = &#039;&#039;;
+  public $mode = &#039;&#039;;
+  public $stats = array();
+  private $getters = array(
+    &#039;css&#039;,
+    &#039;mode&#039;,
+    &#039;stats&#039;,
+  );
+
+  /**
+   * Subclasses that do the ground work for this compressor
+   *
+   * @class CSSCompression: Public facing compression class
+   * @class Option: Option handling
+   * @class Trim: Does the initial trimming for the css
+   * @class Format: Formats the output
+   * @class Numeric: Handles numeric compression
+   * @class Color: Handles color compression
+   * @class Individuals: Runs compression algorithms on individual properties and values
+   * @class Selectors: Runs selector specific compressions
+   * @class Combine: Handles combining of various properties
+   * @class Organize: Reorganizes the sheet for futher compression
+   * @class Cleanup: Cleans out all injected characters during compression
+   * @class Compress: Central compression unit.
+   * @param (array) subclasses: Array holding all the subclasses for inlusion
+   */
+  public $CSSCompression;
+  public $Option;
+  public $Trim;
+  public $Format;
+  public $Numeric;
+  public $Color;
+  public $Individuals;
+  public $Selectors;
+  public $Combine;
+  public $Organize;
+  public $Cleanup;
+  public $Setup;
+  public $Compress;
+  private $subclasses = array(
+    &#039;Option&#039;,
+    &#039;Trim&#039;,
+    &#039;Format&#039;,
+    &#039;Numeric&#039;,
+    &#039;Color&#039;,
+    &#039;Individuals&#039;,
+    &#039;Selectors&#039;,
+    &#039;Combine&#039;,
+    &#039;Organize&#039;,
+    &#039;Cleanup&#039;,
+    &#039;Setup&#039;,
+    &#039;Compress&#039;,
+  );
+
+  /**
+   * Pull in the Compression instance and build the subclasses
+   *
+   * @param (class) CSSCompression: CSSCompression Instance
+   */
+  public function __construct( CSSCompression $CSSCompression ) {
+    $this-&gt;CSSCompression = $CSSCompression;
+
+    // Load all subclasses on demand
+    if ( ! class_exists( &quot;CSSCompression_Option&quot;, false ) ) {
+      $path = dirname(__FILE__) . &#039;/&#039;;
+      foreach ( $this-&gt;subclasses as $class ) {
+        require( $path . $class . &#039;.inc&#039; );
+      }
+    }
+
+    // Initialize each subclass
+    foreach ( $this-&gt;subclasses as $class ) {
+      $full = &quot;CSSCompression_$class&quot;;
+      $this-&gt;$class = new $full( $this );
+    }
+  }
+
+  /**
+   * Control access to properties
+   *
+   *	- Getting stats/mode/css returns the current value of that property
+   *	- Getting options will return the current full options array
+   *	- Getting anything else returns that current value in the options array or NULL
+   *
+   * @param (string) name: Name of property that you want to access
+   */
+  public function get( $name ) {
+    if ( in_array( $name, $this-&gt;getters ) ) {
+      return $this-&gt;$name;
+    }
+    else if ( $name == &#039;options&#039; ) {
+      return $this-&gt;Option-&gt;options;
+    }
+    else {
+      return $this-&gt;Option-&gt;option( $name );
+    }
+  }
+
+  /**
+   * The setter method only allows access to setting values in the options array
+   *
+   * @param (string) name: Key name of the option you want to set
+   * @param (mixed) value: Value of the option you want to set
+   */
+  public function set( $name, $value ) {
+    // Allow for passing array of options to merge into current ones
+    if ( $name === &#039;options&#039; &amp;&amp; is_array( $value ) ) {
+      return $this-&gt;Option-&gt;merge( $value );
+    }
+    else if ( isset( CSSCompression::$defaults[$name] ) ) {
+      return $this-&gt;Option-&gt;option( $name, $value );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Invalid Private Access to $name in CSSCompression.&quot; );
+    }
+  }
+
+  /**
+   * Merges a predefined set options
+   *
+   * @param (string) mode: Name of mode to use.
+   */
+  public function mode( $mode = NULL ) {
+    return $this-&gt;Options-&gt;merge( $mode );
+  }
+
+  /**
+   * Resets options to their defaults, and flushes out variables
+   *
+   * @params none
+   */
+  public function reset() {
+    $this-&gt;Option-&gt;reset();
+    return $this-&gt;flush();
+  }
+
+  /**
+   * Cleans out class variables for next run
+   *
+   * @params none
+   */
+  public function flush() {
+    $this-&gt;css = &#039;&#039;;
+    $this-&gt;stats = array(
+      &#039;before&#039; =&gt; array(
+        &#039;props&#039; =&gt; 0,
+        &#039;selectors&#039; =&gt; 0,
+        &#039;size&#039; =&gt; 0,
+        &#039;time&#039; =&gt; 0,
+      ),
+      &#039;after&#039; =&gt; array(
+        &#039;props&#039; =&gt; 0,
+        &#039;selectors&#039; =&gt; 0,
+        &#039;size&#039; =&gt; 0,
+        &#039;time&#039; =&gt; 0,
+      ),
+    );
+
+    return true;
+  }
+
+  /**
+   * Proxy to run Compression on the sheet passed. Handle options here.
+   *
+   * @param (string) css: Stylesheet to be compressed
+   * @param (mixed) options: Array of options or mode to use.
+   */
+  public function compress( $css = NULL, $options = NULL ) {
+    // Flush out old stats and variables
+    $this-&gt;flush();
+
+    // If no additional options, just run compression
+    if ( $options === NULL ) {
+      return $this-&gt;css = $this-&gt;Compress-&gt;compress( $css );
+    }
+
+    // Store old params
+    $old = $this-&gt;mode == &#039;__custom&#039; ? $this-&gt;Option-&gt;option() : $this-&gt;mode;
+    $readability = $this-&gt;Option-&gt;option( &#039;readability&#039; );
+
+    // Compress with new set of options
+    $this-&gt;Option-&gt;merge( $options );
+    $css = $this-&gt;Compress-&gt;compress( $css );
+
+    // Reset original options
+    $this-&gt;reset();
+    $this-&gt;Option-&gt;merge( $old );
+
+    // Return the compressed css
+    return $this-&gt;css = $css;
+  }
+
+  /**
+   * Backdoor access to subclasses
+   * ONLY FOR DEVELOPMENT/TESTING.
+   *
+   * @param (string) class: Name of the focus class
+   * @param (array) config: Contains name reference and test arguments
+   */
+  public function access( $class, $method, $args ) {
+    if ( $class == &#039;Control&#039; ) {
+      return call_user_func_array( array($class, $method), $args );
+    }
+    else if ( strpos( $class, &#039;.&#039; ) !== false ) {
+      $parts = explode( &#039;.&#039;, $class );
+      $class = $parts[0];
+      $subclass = $parts[1];
+      return $this-&gt;$class-&gt;access( $subclass, $method, $args );
+    }
+    else if ( in_array( $class, $this-&gt;subclasses ) ) {
+      return $this-&gt;$class-&gt;access( $method, $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown Class Access - &quot; . $class );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Exception.inc advagg_css_compress/css-compressor-3.x/src/lib/Exception.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Exception.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Exception.inc	2012-03-23 13:02:19.000000000 -0600
@@ -6,25 +6,24 @@
  */
 
 
-Class CSSCompression_Exception extends Exception
-{
-	/**
-	 * Custom exception handler
-	 *
-	 * @param (string) message: Error message
-	 * @param (int) code: Error code
-	 * @instance (Exception Instance) previous: Previous exception
-	 */
-	public function __construct( $message = &#039;Unknown Exception&#039;, $code = 0, Exception $previous = NULL ) {
-		parent::__construct( $message, $code, $previous );
-	}
+class CSSCompression_Exception extends Exception {
+  /**
+   * Custom exception handler
+   *
+   * @param (string) message: Error message
+   * @param (int) code: Error code
+   * @instance (Exception Instance) previous: Previous exception
+   */
+  public function __construct( $message = &#039;Unknown Exception&#039;, $code = 0, Exception $previous = NULL ) {
+    parent::__construct( $message, $code, $previous );
+  }
 
-	/**
-	 * String version of this custom exception
-	 *
-	 * @params none
-	 */
-	public function __toString(){
-		return &quot;CSSCompression Exception: [&quot; . $this-&gt;code . &quot;] &quot; . $this-&gt;message . &quot;\n&quot;;
-	}
-};
+  /**
+   * String version of this custom exception
+   *
+   * @params none
+   */
+  public function __toString() {
+    return &quot;CSSCompression Exception: [&quot; . $this-&gt;code . &quot;] &quot; . $this-&gt;message . &quot;\n&quot;;
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Format.inc advagg_css_compress/css-compressor-3.x/src/lib/Format.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Format.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Format.inc	2012-03-23 13:02:19.000000000 -0600
@@ -5,181 +5,180 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Format
-{
-	/**
-	 * Format Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @param (string) token: Copy of the injection token
-	 * @param (array) options: Reference to options
-	 * @param (regex) rsemicolon: Checks for semicolon without an escape &#039;\&#039; character before it
-	 * @param (regex) rcolon: Checks for colon without an escape &#039;\&#039; character before it
-	 * @param (array) readability: Mapping to readability functions
-	 */
-	private $Control;
-	private $token = &#039;&#039;;
-	private $options = array();
-	private $rsemicolon = &quot;/(?&lt;!\\\);/&quot;;
-	private $rcolon = &quot;/(?&lt;!\\\):/&quot;;
-	private $readability = array(
-		CSSCompression::READ_MAX =&gt; &#039;maximum&#039;,
-		CSSCompression::READ_MED =&gt; &#039;medium&#039;,
-		CSSCompression::READ_MIN =&gt; &#039;minimum&#039;,
-		CSSCompression::READ_NONE =&gt; &#039;none&#039;,
-	);
-
-	/**
-	 * Stash a reference to the controller on each instantiation
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 */
-	public function __construct( CSSCompression_Control $control ) {
-		$this-&gt;Control = $control;
-		$this-&gt;token = CSSCompression::TOKEN;
-		$this-&gt;options = &amp;$control-&gt;Option-&gt;options;
-	}
-
-
-	/**
-	 * Reformats compressed CSS into specified format
-	 *
-	 * @param (int) readability: Readability level of compressed output
-	 * @param (array) selectors: Array of selectors
-	 * @param (array) details: Array of declarations
-	 */
-	public function readability( $readability = CSSCompression::READ_NONE, $selectors = array(), $details = array() ) {
-		if ( isset( $this-&gt;readability[ $readability ] ) ) {
-			$fn = $this-&gt;readability[ $readability ];
-			return trim( $this-&gt;$fn( $selectors, $details ) );
-		}
-		else {
-			return &#039;Invalid Readability Value&#039;;
-		}
-	}
-
-	/**
-	 * Returns maxium readability, breaking on every selector, brace, and property
-	 *
-	 * @param (array) selectors: Array of selectors
-	 * @param (array) details: Array of declarations
-	 */
-	private function maximum( $selectors, $details ) {
-		$css = &#039;&#039;;
-		foreach ( $selectors as $k =&gt; $v ) {
-			if ( strpos( $v, $this-&gt;token ) === 0 ) {
-				$css .= substr( $v, strlen( $this-&gt;token ) );
-				$css .= $details[ $k ];
-				continue;
-			}
-			else if ( ! $details[ $k ] || trim( $details[ $k ] ) == &#039;&#039; ) {
-				continue;
-			}
-
-			$v = str_replace( &#039;&gt;&#039;, &#039; &gt; &#039;, $v );
-			$v = str_replace( &#039;+&#039;, &#039; + &#039;, $v );
-			$v = str_replace( &#039;,&#039;, &#039;, &#039;, $v );
-			$css .= &quot;$v {\n&quot;;
-			$arr = preg_split( $this-&gt;rsemicolon, $details[ $k ] );
-
-			foreach ( $arr as $item ) {
-				if ( ! $item ) {
-					continue;
-				}
-
-				list( $prop, $val ) = preg_split( $this-&gt;rcolon, $item, 2 );
-				$css .= &quot;\t$prop: $val;\n&quot;;
-			}
-
-			// Kill that last semicolon at users request
-			if ( $this-&gt;options[&#039;unnecessary-semicolons&#039;] ) {
-				$css = preg_replace( &quot;/;\n$/&quot;, &quot;\n&quot;, $css );
-			}
-
-			$css .= &quot;}\n\n&quot;;
-		}
-
-		return $css;
-	}
-
-	/**
-	 * Returns medium readability, putting selectors and rule sets on new lines
-	 *
-	 * @param (array) selectors: Array of selectors
-	 * @param (array) details: Array of declarations
-	 */
-	private function medium( $selectors, $details ) {
-		$css = &#039;&#039;;
-		foreach ( $selectors as $k =&gt; $v ) {
-			if ( strpos( $v, $this-&gt;token ) === 0 ) {
-				$css .= substr( $v, strlen( $this-&gt;token ) );
-				$css .= $details[ $k ];
-				continue;
-			}
-			else if ( $details[ $k ] &amp;&amp; $details[ $k ] != &#039;&#039; ) {
-				$css .= &quot;$v {\n\t&quot; . $details[ $k ] . &quot;\n}\n&quot;;
-			}
-		}
-
-		return $css;
-	}
-
-	/**
-	 * Returns minimum readability, breaking after every selector and it&#039;s rule set
-	 *
-	 * @param (array) selectors: Array of selectors
-	 * @param (array) details: Array of declarations
-	 */
-	private function minimum( $selectors, $details ) {
-		$css = &#039;&#039;;
-		foreach ( $selectors as $k =&gt; $v ) {
-			if ( strpos( $v, $this-&gt;token ) === 0 ) {
-				$css .= substr( $v, strlen( $this-&gt;token ) );
-				$css .= $details[ $k ];
-				continue;
-			}
-			else if ( $details[ $k ] &amp;&amp; $details[ $k ] != &#039;&#039; ) {
-				$css .= &quot;$v{&quot; . $details[ $k ] . &quot;}\n&quot;;
-			}
-		}
-
-		return $css;
-	}
-
-	/**
-	 * Returns an unreadable, but fully compressed script
-	 *
-	 * @param (array) selectors: Array of selectors
-	 * @param (array) details: Array of declarations
-	 */
-	private function none( $selectors, $details ) {
-		$css = &#039;&#039;;
-		foreach ( $selectors as $k =&gt; $v ) {
-			if ( strpos( $v, $this-&gt;token ) === 0 ) {
-				$css .= substr( $v, strlen( $this-&gt;token ) );
-				$css .= $details[ $k ];
-				continue;
-			}
-			else if ( $details[ $k ] &amp;&amp; $details[ $k ] != &#039;&#039; ) {
-				$css .= trim( &quot;$v{&quot; . $details[ $k ] . &quot;}&quot; );
-			}
-		}
-
-		return $css;
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Format Class - &quot; . $method );
-		}
-	}
-};
+class CSSCompression_Format {
+  /**
+   * Format Patterns
+   *
+   * @class Control: Compression Controller
+   * @param (string) token: Copy of the injection token
+   * @param (array) options: Reference to options
+   * @param (regex) rsemicolon: Checks for semicolon without an escape &#039;\&#039; character before it
+   * @param (regex) rcolon: Checks for colon without an escape &#039;\&#039; character before it
+   * @param (array) readability: Mapping to readability functions
+   */
+  private $Control;
+  private $token = &#039;&#039;;
+  private $options = array();
+  private $rsemicolon = &quot;/(?&lt;!\\\);/&quot;;
+  private $rcolon = &quot;/(?&lt;!\\\):/&quot;;
+  private $readability = array(
+    CSSCompression::READ_MAX =&gt; &#039;maximum&#039;,
+    CSSCompression::READ_MED =&gt; &#039;medium&#039;,
+    CSSCompression::READ_MIN =&gt; &#039;minimum&#039;,
+    CSSCompression::READ_NONE =&gt; &#039;none&#039;,
+  );
+
+  /**
+   * Stash a reference to the controller on each instantiation
+   *
+   * @param (class) control: CSSCompression Controller
+   */
+  public function __construct( CSSCompression_Control $control ) {
+    $this-&gt;Control = $control;
+    $this-&gt;token = CSSCompression::TOKEN;
+    $this-&gt;options = &amp;$control-&gt;Option-&gt;options;
+  }
+
+
+  /**
+   * Reformats compressed CSS into specified format
+   *
+   * @param (int) readability: Readability level of compressed output
+   * @param (array) selectors: Array of selectors
+   * @param (array) details: Array of declarations
+   */
+  public function readability( $readability = CSSCompression::READ_NONE, $selectors = array(), $details = array() ) {
+    if ( isset( $this-&gt;readability[$readability] ) ) {
+      $fn = $this-&gt;readability[$readability];
+      return trim( $this-&gt;$fn( $selectors, $details ) );
+    }
+    else {
+      return &#039;Invalid Readability Value&#039;;
+    }
+  }
+
+  /**
+   * Returns maxium readability, breaking on every selector, brace, and property
+   *
+   * @param (array) selectors: Array of selectors
+   * @param (array) details: Array of declarations
+   */
+  private function maximum( $selectors, $details ) {
+    $css = &#039;&#039;;
+    foreach ( $selectors as $k =&gt; $v ) {
+      if ( strpos( $v, $this-&gt;token ) === 0 ) {
+        $css .= substr( $v, strlen( $this-&gt;token ) );
+        $css .= $details[$k];
+        continue;
+      }
+      else if ( ! $details[$k] || trim( $details[$k] ) == &#039;&#039; ) {
+        continue;
+      }
+
+      $v = str_replace( &#039;&gt;&#039;, &#039; &gt; &#039;, $v );
+      $v = str_replace( &#039;+&#039;, &#039; + &#039;, $v );
+      $v = str_replace( &#039;,&#039;, &#039;, &#039;, $v );
+      $css .= &quot;$v {\n&quot;;
+      $arr = preg_split( $this-&gt;rsemicolon, $details[$k] );
+
+      foreach ( $arr as $item ) {
+        if ( ! $item ) {
+          continue;
+        }
+
+        list( $prop, $val ) = preg_split( $this-&gt;rcolon, $item, 2 );
+        $css .= &quot;\t$prop: $val;\n&quot;;
+      }
+
+      // Kill that last semicolon at users request
+      if ( $this-&gt;options[&#039;unnecessary-semicolons&#039;] ) {
+        $css = preg_replace( &quot;/;\n$/&quot;, &quot;\n&quot;, $css );
+      }
+
+      $css .= &quot;}\n\n&quot;;
+    }
+
+    return $css;
+  }
+
+  /**
+   * Returns medium readability, putting selectors and rule sets on new lines
+   *
+   * @param (array) selectors: Array of selectors
+   * @param (array) details: Array of declarations
+   */
+  private function medium( $selectors, $details ) {
+    $css = &#039;&#039;;
+    foreach ( $selectors as $k =&gt; $v ) {
+      if ( strpos( $v, $this-&gt;token ) === 0 ) {
+        $css .= substr( $v, strlen( $this-&gt;token ) );
+        $css .= $details[$k];
+        continue;
+      }
+      else if ( $details[$k] &amp;&amp; $details[$k] != &#039;&#039; ) {
+        $css .= &quot;$v {\n\t&quot; . $details[$k] . &quot;\n}\n&quot;;
+      }
+    }
+
+    return $css;
+  }
+
+  /**
+   * Returns minimum readability, breaking after every selector and it&#039;s rule set
+   *
+   * @param (array) selectors: Array of selectors
+   * @param (array) details: Array of declarations
+   */
+  private function minimum( $selectors, $details ) {
+    $css = &#039;&#039;;
+    foreach ( $selectors as $k =&gt; $v ) {
+      if ( strpos( $v, $this-&gt;token ) === 0 ) {
+        $css .= substr( $v, strlen( $this-&gt;token ) );
+        $css .= $details[$k];
+        continue;
+      }
+      else if ( $details[$k] &amp;&amp; $details[$k] != &#039;&#039; ) {
+        $css .= &quot;$v{&quot; . $details[$k] . &quot;}\n&quot;;
+      }
+    }
+
+    return $css;
+  }
+
+  /**
+   * Returns an unreadable, but fully compressed script
+   *
+   * @param (array) selectors: Array of selectors
+   * @param (array) details: Array of declarations
+   */
+  private function none( $selectors, $details ) {
+    $css = &#039;&#039;;
+    foreach ( $selectors as $k =&gt; $v ) {
+      if ( strpos( $v, $this-&gt;token ) === 0 ) {
+        $css .= substr( $v, strlen( $this-&gt;token ) );
+        $css .= $details[$k];
+        continue;
+      }
+      else if ( $details[$k] &amp;&amp; $details[$k] != &#039;&#039; ) {
+        $css .= trim( &quot;$v{&quot; . $details[$k] . &quot;}&quot; );
+      }
+    }
+
+    return $css;
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Format Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Individuals.inc advagg_css_compress/css-compressor-3.x/src/lib/Individuals.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Individuals.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Individuals.inc	2012-03-23 13:02:19.000000000 -0600
@@ -5,301 +5,300 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Individuals
-{
-	/**
-	 * Individual patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @class Numeric: Numeric handler
-	 * @class Color: Color Handler
-	 * @param (array) options: Reference to options
-	 * @param (regex) rdirectional: Properties that may have multiple directions
-	 * @param (regex) rborderradius: Checks property for border-radius declaration
-	 * @param (regex) rnoneprop: Properties that can have none as their value(will be converted to 0)
-	 * @param (regex) rclip: Looks for rect grouping in clip declaration
-	 * @param (regex) rsplitter: Checks font properties for font-size/line-height split
-	 * @param (regex) rfilter: Special alpha filter for msie
-	 * @param (regex) rspace: Checks for unescaped space
-	 * @param (regex) rspace: Checks for unescaped slash
-	 * @param (array) weights: Array of font-weight name conversions to their numeric counterpart
-	 */
-	private $Control;
-	private $Numeric;
-	private $Color;
-	private $options = array();
-	private $rdirectional = &quot;/^(margin|padding|border-spacing)$/&quot;;
-	private $rborderradius = &quot;/border[a-z-]*radius/&quot;;
-	private $rradiusfull = &quot;/^(-moz-|-webkit-)?border-radius$/&quot;;
-	private $rnoneprop = &quot;/^(border|background|border-(top|right|bottom|left))$/&quot;;
-	private $rclip = &quot;/^rect\(\s*(\-?\d*\.?\d*?\w*)(,|\s)(\-?\d*\.?\d*?\w*)(,|\s)(\-?\d*\.?\d*?\w*)(,|\s)(\-?\d*\.?\d*?\w*)\s*\)$/&quot;;
-	private $rsplitter = &quot;/(^|(?&lt;!\\\)\s)([^\/ ]+)\/([^\/ ]+)((?&lt;!\\\)\s|$)/&quot;;
-	private $rfilter = &quot;/[\&quot;&#039;]?PROGID\\\?:DXImageTransform\\\?.Microsoft\\\?.Alpha\(Opacity\\\?=(\d+\\\?\.?\d*)\)[\&quot;&#039;]?/i&quot;;
-	private $rspace = &quot;/(?&lt;!\\\)\s/&quot;;
-	private $rslash = &quot;/(?&lt;!\\\)\//&quot;;
-	private $weights = array(
-		&quot;normal&quot; =&gt; 400,
-		&quot;bold&quot; =&gt; 700,
-	);
-
-	/**
-	 * Stash a reference to the controller on each instantiation
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 */
-	public function __construct( CSSCompression_Control $control ) {
-		$this-&gt;Control = $control;
-		$this-&gt;Numeric = $control-&gt;Numeric;
-		$this-&gt;Color = $control-&gt;Color;
-		$this-&gt;options = &amp;$control-&gt;Option-&gt;options;
-	}
-
-	/**
-	 * Runs special unit/directional compressions
-	 *
-	 * @param (string) prop: CSS Property
-	 * @param (string) val: Value of CSS Property
-	 */
-	public function individuals( $prop, $val ) {
-		// Properties should always be lowercase
-		$prop = strtolower( $prop );
-
-		// Split up each definiton for color and numeric compressions
-		$parts = preg_split( $this-&gt;rspace, $val );
-		foreach ( $parts as &amp;$v ) {
-			if ( ! $v || $v == &#039;&#039; ) {
-				continue;
-			}
-
-			// Remove uneeded decimals/units
-			if ( $this-&gt;options[&#039;format-units&#039;] ) {
-				$v = $this-&gt;Numeric-&gt;numeric( $v );
-			}
-
-			// Color compression
-			$v = $this-&gt;Color-&gt;color( $v );
-		}
-		$val = trim( implode( &#039; &#039;, $parts ) );
-
-		// Special border radius handling
-		if ( preg_match( $this-&gt;rborderradius, $prop ) ) {
-			$val = $this-&gt;borderRadius( $prop, $val );
-		}
-		// Remove uneeded side definitions if possible
-		else if ( $this-&gt;options[&#039;directional-compress&#039;] &amp;&amp; count( $parts ) &gt; 1 &amp;&amp; preg_match( $this-&gt;rdirectional, $prop ) ) {
-			$val = $this-&gt;directionals( strtolower( $val ) );
-		}
-
-		// Font-weight converter
-		if ( $this-&gt;options[&#039;fontweight2num&#039;] &amp;&amp; ( $prop == &#039;font-weight&#039; || $prop == &#039;font&#039; ) ) {
-			$val = $this-&gt;fontweight( $val );
-		}
-
-		// Special font value conversions
-		if ( $prop == &#039;font&#039; ) {
-			$val = $this-&gt;font( $val );
-		}
-
-		// Special clip value compressions
-		if ( $prop == &#039;clip&#039; ) {
-			$val = $this-&gt;clip( $val );
-		}
-
-		// None to 0 converter
-		$val = $this-&gt;none( $prop, $val );
-
-		// MSIE Filters
-		$val = $this-&gt;filter( $prop, $val );
-
-		// Return for list retrival
-		return array( $prop, $val );
-	}
-
-	/**
-	 * Preps border radius for directional compression
-	 *
-	 * @param (string) prop: Property Declaration
-	 * @param (string) val: Declaration Value
-	 */
-	private function borderRadius( $prop, $val ) {
-		if ( preg_match( $this-&gt;rslash, $val ) ) {
-			$parts = preg_split( $this-&gt;rslash, $val, 2 );
-			// We have to redo numeric compression because the slash may hav intruded
-			foreach ( $parts as &amp;$row ) {
-				$p = preg_split( $this-&gt;rspace, $row );
-				foreach ( $p as &amp;$v ) {
-					if ( ! $v || $v == &#039;&#039; ) {
-						continue;
-					}
-
-					// Remove uneeded decimals/units
-					if ( $this-&gt;options[&#039;format-units&#039;] ) {
-						$v = $this-&gt;Numeric-&gt;numeric( $v );
-					}
-				}
-				$row = implode( &#039; &#039;, $p );
-				if ( $this-&gt;options[&#039;directional-compress&#039;] ) {
-					$row = $this-&gt;directionals( strtolower( $row ) );
-				}
-			}
-			$val = implode( &#039;/&#039;, $parts );
-		}
-		else if ( $this-&gt;options[&#039;directional-compress&#039;] &amp;&amp; preg_match( $this-&gt;rradiusfull, $prop ) ) {
-			$val = $this-&gt;directionals( strtolower( $val ) );
-		}
-
-		return $val;
-	}
-
-	/**
-	 * Finds directional compression on methods like margin/padding
-	 *
-	 * @param (string) val: Value of CSS Property
-	 */
-	private function directionals( $val ) {
-		// Split up each definiton
-		$direction = preg_split( $this-&gt;rspace, $val );
-
-		// 4 Direction reduction
-		$count = count( $direction );
-		if ( $count == 4 ) {
-			// All 4 sides are the same, combine into 1 definition
-			if ( $direction[ 0 ] == $direction[ 1 ] &amp;&amp; $direction[ 2 ] == $direction[ 3 ] &amp;&amp; $direction[ 0 ] == $direction[ 3 ] ) {
-				$direction = array( $direction[ 0 ] );
-			}
-			// top-bottom/left-right are the same, reduce definition
-			else if ( $direction[ 0 ] == $direction[ 2 ] &amp;&amp; $direction[ 1 ] == $direction[ 3 ] ) {
-				$direction = array( $direction[ 0 ], $direction[ 1 ] );
-			}
-			// Only left-right are the same
-			else if ( $direction[ 1 ] == $direction[ 3 ] ) {
-				$direction = array( $direction[ 0 ], $direction[ 1 ], $direction[ 2 ] );
-			}
-		}
-		// 3 Direction reduction
-		else if ( $count == 3 ) {
-			// All directions are the same
-			if ( $direction[ 0 ] == $direction[ 1 ] &amp;&amp; $direction[ 1 ] == $direction[ 2 ] ) {
-				$direction = array( $direction[ 0 ] );
-			}
-			// Only top(first) and bottom(last) are the same
-			else if ( $direction[ 0 ] == $direction[ 2 ] ) {
-				$direction = array( $direction[ 0 ], $direction[ 1 ] );
-			}
-		}
-		// 2 Direction reduction
-		// Both directions are the same, combine into single definition
-		else if ( $count == 2 &amp;&amp; $direction[ 0 ] == $direction[ 1 ] ) {
-			$direction = array( $direction[ 0 ] );
-		}
-
-		// Return the combined version of the directions
-		// Single entries will just return
-		return implode( &#039; &#039;, $direction );
-	}
-
-	/**
-	 * Converts font-weight names to numbers
-	 *
-	 * @param (string) val: font-weight prop value
-	 */
-	private function fontweight( $val ) {
-		if ( preg_match( $this-&gt;rspace, $val ) ) {
-			$parts = preg_split( $this-&gt;rspace, $val );
-			foreach ( $parts as &amp;$item ) {
-				$lower = strtolower( $item );
-				if ( isset( $this-&gt;weights[ $lower ] ) &amp;&amp; $lower != &#039;normal&#039; ) {
-					$item = $this-&gt;weights[ $lower ];
-				}
-			}
-			$val = implode( &#039; &#039;, $parts );
-		}
-		else if ( isset( $this-&gt;weights[ strtolower( $val ) ] ) ) {
-			$val = $this-&gt;weights[ strtolower( $val ) ];
-		}
-
-		return $val;
-	}
-
-	/**
-	 * Special font conversions
-	 *
-	 * @param (string) val: property value
-	 */
-	private function font( $val ) {
-		// Split out the font-size/line-height split and run through numerical handlers
-		if ( preg_match( $this-&gt;rsplitter, $val, $match, PREG_OFFSET_CAPTURE ) ) {
-			$size = $this-&gt;Numeric-&gt;numeric( $match[ 2 ][ 0 ] );
-			$height = $this-&gt;Numeric-&gt;numeric( $match[ 3 ][ 0 ] );
-			$concat = $match[ 1 ][ 0 ] . $size . &#039;/&#039; . $height . $match[ 4 ][ 0 ];
-			$val = substr_replace( $val, $concat, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] )  );
-		}
-
-		return $val;
-	}
-
-	/**
-	 * Special clip conversions
-	 *
-	 * @param (string) val: property value
-	 */
-	private function clip( $val ) {
-		if ( preg_match( $this-&gt;rclip, $val, $match ) ) {
-			$positions = array( 1, 3, 5, 7 );
-			$clean = &#039;rect(&#039;;
-			foreach ( $positions as $pos ) {
-				if ( ! isset( $match[ $pos ] ) ) {
-					return $val;
-				}
-
-				$clean .= $this-&gt;Numeric-&gt;numeric( $match[ $pos ] ) . ( isset( $match[ $pos + 1 ] ) ? $match[ $pos + 1 ] : &#039;&#039; );
-			}
-			$val = $clean . &#039;)&#039;;
-		}
-
-		return $val;
-	}
-
-	/**
-	 * Convert none vals to 0
-	 *
-	 * @param (string) prop: Current Property
-	 * @param (string) val: property value
-	 */
-	private function none( $prop, $val ) {
-		if ( preg_match( $this-&gt;rnoneprop, $prop ) &amp;&amp; $val == &#039;none&#039; ) {
-			$val = &#039;0&#039;;
-		}
-
-		return $val;
-	}
-
-	/**
-	 * MSIE Filter Conversion
-	 *
-	 * @param (string) prop: Current Property
-	 * @param (string) val: property value
-	 */
-	private function filter( $prop, $val ) {
-		if ( preg_match( &quot;/filter/&quot;, $prop ) ) {
-			$val = preg_replace( $this-&gt;rfilter, &quot;alpha(opacity=$1)&quot;, $val );
-		}
-
-		return $val;
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Individuals Class - &quot; . $method );
-		}
-	}
-};
+class CSSCompression_Individuals {
+  /**
+   * Individual patterns
+   *
+   * @class Control: Compression Controller
+   * @class Numeric: Numeric handler
+   * @class Color: Color Handler
+   * @param (array) options: Reference to options
+   * @param (regex) rdirectional: Properties that may have multiple directions
+   * @param (regex) rborderradius: Checks property for border-radius declaration
+   * @param (regex) rnoneprop: Properties that can have none as their value(will be converted to 0)
+   * @param (regex) rclip: Looks for rect grouping in clip declaration
+   * @param (regex) rsplitter: Checks font properties for font-size/line-height split
+   * @param (regex) rfilter: Special alpha filter for msie
+   * @param (regex) rspace: Checks for unescaped space
+   * @param (regex) rspace: Checks for unescaped slash
+   * @param (array) weights: Array of font-weight name conversions to their numeric counterpart
+   */
+  private $Control;
+  private $Numeric;
+  private $Color;
+  private $options = array();
+  private $rdirectional = &quot;/^(margin|padding|border-spacing)$/&quot;;
+  private $rborderradius = &quot;/border[a-z-]*radius/&quot;;
+  private $rradiusfull = &quot;/^(-moz-|-webkit-)?border-radius$/&quot;;
+  private $rnoneprop = &quot;/^(border|background|border-(top|right|bottom|left))$/&quot;;
+  private $rclip = &quot;/^rect\(\s*(\-?\d*\.?\d*?\w*)(,|\s)(\-?\d*\.?\d*?\w*)(,|\s)(\-?\d*\.?\d*?\w*)(,|\s)(\-?\d*\.?\d*?\w*)\s*\)$/&quot;;
+  private $rsplitter = &quot;/(^|(?&lt;!\\\)\s)([^\/ ]+)\/([^\/ ]+)((?&lt;!\\\)\s|$)/&quot;;
+  private $rfilter = &quot;/[\&quot;&#039;]?PROGID\\\?:DXImageTransform\\\?.Microsoft\\\?.Alpha\(Opacity\\\?=(\d+\\\?\.?\d*)\)[\&quot;&#039;]?/i&quot;;
+  private $rspace = &quot;/(?&lt;!\\\)\s/&quot;;
+  private $rslash = &quot;/(?&lt;!\\\)\//&quot;;
+  private $weights = array(
+    &quot;normal&quot; =&gt; 400,
+    &quot;bold&quot; =&gt; 700,
+  );
+
+  /**
+   * Stash a reference to the controller on each instantiation
+   *
+   * @param (class) control: CSSCompression Controller
+   */
+  public function __construct( CSSCompression_Control $control ) {
+    $this-&gt;Control = $control;
+    $this-&gt;Numeric = $control-&gt;Numeric;
+    $this-&gt;Color = $control-&gt;Color;
+    $this-&gt;options = &amp;$control-&gt;Option-&gt;options;
+  }
+
+  /**
+   * Runs special unit/directional compressions
+   *
+   * @param (string) prop: CSS Property
+   * @param (string) val: Value of CSS Property
+   */
+  public function individuals( $prop, $val ) {
+    // Properties should always be lowercase
+    $prop = strtolower( $prop );
+
+    // Split up each definiton for color and numeric compressions
+    $parts = preg_split( $this-&gt;rspace, $val );
+    foreach ( $parts as &amp;$v ) {
+      if ( ! $v || $v == &#039;&#039; ) {
+        continue;
+      }
+
+      // Remove uneeded decimals/units
+      if ( $this-&gt;options[&#039;format-units&#039;] ) {
+        $v = $this-&gt;Numeric-&gt;numeric( $v );
+      }
+
+      // Color compression
+      $v = $this-&gt;Color-&gt;color( $v );
+    }
+    $val = trim( implode( &#039; &#039;, $parts ) );
+
+    // Special border radius handling
+    if ( preg_match( $this-&gt;rborderradius, $prop ) ) {
+      $val = $this-&gt;borderRadius( $prop, $val );
+    }
+    // Remove uneeded side definitions if possible
+    else if ( $this-&gt;options[&#039;directional-compress&#039;] &amp;&amp; count( $parts ) &gt; 1 &amp;&amp; preg_match( $this-&gt;rdirectional, $prop ) ) {
+      $val = $this-&gt;directionals( strtolower( $val ) );
+    }
+
+    // Font-weight converter
+    if ( $this-&gt;options[&#039;fontweight2num&#039;] &amp;&amp; ( $prop == &#039;font-weight&#039; || $prop == &#039;font&#039; ) ) {
+      $val = $this-&gt;fontweight( $val );
+    }
+
+    // Special font value conversions
+    if ( $prop == &#039;font&#039; ) {
+      $val = $this-&gt;font( $val );
+    }
+
+    // Special clip value compressions
+    if ( $prop == &#039;clip&#039; ) {
+      $val = $this-&gt;clip( $val );
+    }
+
+    // None to 0 converter
+    $val = $this-&gt;none( $prop, $val );
+
+    // MSIE Filters
+    $val = $this-&gt;filter( $prop, $val );
+
+    // Return for list retrival
+    return array($prop, $val);
+  }
+
+  /**
+   * Preps border radius for directional compression
+   *
+   * @param (string) prop: Property Declaration
+   * @param (string) val: Declaration Value
+   */
+  private function borderRadius( $prop, $val ) {
+    if ( preg_match( $this-&gt;rslash, $val ) ) {
+      $parts = preg_split( $this-&gt;rslash, $val, 2 );
+      // We have to redo numeric compression because the slash may hav intruded
+      foreach ( $parts as &amp;$row ) {
+        $p = preg_split( $this-&gt;rspace, $row );
+        foreach ( $p as &amp;$v ) {
+          if ( ! $v || $v == &#039;&#039; ) {
+            continue;
+          }
+
+          // Remove uneeded decimals/units
+          if ( $this-&gt;options[&#039;format-units&#039;] ) {
+            $v = $this-&gt;Numeric-&gt;numeric( $v );
+          }
+        }
+        $row = implode( &#039; &#039;, $p );
+        if ( $this-&gt;options[&#039;directional-compress&#039;] ) {
+          $row = $this-&gt;directionals( strtolower( $row ) );
+        }
+      }
+      $val = implode( &#039;/&#039;, $parts );
+    }
+    else if ( $this-&gt;options[&#039;directional-compress&#039;] &amp;&amp; preg_match( $this-&gt;rradiusfull, $prop ) ) {
+      $val = $this-&gt;directionals( strtolower( $val ) );
+    }
+
+    return $val;
+  }
+
+  /**
+   * Finds directional compression on methods like margin/padding
+   *
+   * @param (string) val: Value of CSS Property
+   */
+  private function directionals( $val ) {
+    // Split up each definiton
+    $direction = preg_split( $this-&gt;rspace, $val );
+
+    // 4 Direction reduction
+    $count = count( $direction );
+    if ( $count == 4 ) {
+      // All 4 sides are the same, combine into 1 definition
+      if ( $direction[0] == $direction[1] &amp;&amp; $direction[2] == $direction[3] &amp;&amp; $direction[0] == $direction[3] ) {
+        $direction = array($direction[0]);
+      }
+      // top-bottom/left-right are the same, reduce definition
+      else if ( $direction[0] == $direction[2] &amp;&amp; $direction[1] == $direction[3] ) {
+        $direction = array($direction[0], $direction[1]);
+      }
+      // Only left-right are the same
+      else if ( $direction[1] == $direction[3] ) {
+        $direction = array($direction[0], $direction[1], $direction[2]);
+      }
+    }
+    // 3 Direction reduction
+    else if ( $count == 3 ) {
+      // All directions are the same
+      if ( $direction[0] == $direction[1] &amp;&amp; $direction[1] == $direction[2] ) {
+        $direction = array($direction[0]);
+      }
+      // Only top(first) and bottom(last) are the same
+      else if ( $direction[0] == $direction[2] ) {
+        $direction = array($direction[0], $direction[1]);
+      }
+    }
+    // 2 Direction reduction
+    // Both directions are the same, combine into single definition
+    else if ( $count == 2 &amp;&amp; $direction[0] == $direction[1] ) {
+      $direction = array($direction[0]);
+    }
+
+    // Return the combined version of the directions
+    // Single entries will just return
+    return implode( &#039; &#039;, $direction );
+  }
+
+  /**
+   * Converts font-weight names to numbers
+   *
+   * @param (string) val: font-weight prop value
+   */
+  private function fontweight( $val ) {
+    if ( preg_match( $this-&gt;rspace, $val ) ) {
+      $parts = preg_split( $this-&gt;rspace, $val );
+      foreach ( $parts as &amp;$item ) {
+        $lower = strtolower( $item );
+        if ( isset( $this-&gt;weights[$lower] ) &amp;&amp; $lower != &#039;normal&#039; ) {
+          $item = $this-&gt;weights[$lower];
+        }
+      }
+      $val = implode( &#039; &#039;, $parts );
+    }
+    else if ( isset( $this-&gt;weights[strtolower( $val )] ) ) {
+      $val = $this-&gt;weights[strtolower( $val )];
+    }
+
+    return $val;
+  }
+
+  /**
+   * Special font conversions
+   *
+   * @param (string) val: property value
+   */
+  private function font( $val ) {
+    // Split out the font-size/line-height split and run through numerical handlers
+    if ( preg_match( $this-&gt;rsplitter, $val, $match, PREG_OFFSET_CAPTURE ) ) {
+      $size = $this-&gt;Numeric-&gt;numeric( $match[2][0] );
+      $height = $this-&gt;Numeric-&gt;numeric( $match[3][0] );
+      $concat = $match[1][0] . $size . &#039;/&#039; . $height . $match[4][0];
+      $val = substr_replace( $val, $concat, $match[0][1], strlen( $match[0][0] )  );
+    }
+
+    return $val;
+  }
+
+  /**
+   * Special clip conversions
+   *
+   * @param (string) val: property value
+   */
+  private function clip( $val ) {
+    if ( preg_match( $this-&gt;rclip, $val, $match ) ) {
+      $positions = array(1, 3, 5, 7);
+      $clean = &#039;rect(&#039;;
+      foreach ( $positions as $pos ) {
+        if ( ! isset( $match[$pos] ) ) {
+          return $val;
+        }
+
+        $clean .= $this-&gt;Numeric-&gt;numeric( $match[$pos] ) . ( isset( $match[$pos + 1] ) ? $match[$pos + 1] : &#039;&#039; );
+      }
+      $val = $clean . &#039;)&#039;;
+    }
+
+    return $val;
+  }
+
+  /**
+   * Convert none vals to 0
+   *
+   * @param (string) prop: Current Property
+   * @param (string) val: property value
+   */
+  private function none( $prop, $val ) {
+    if ( preg_match( $this-&gt;rnoneprop, $prop ) &amp;&amp; $val == &#039;none&#039; ) {
+      $val = &#039;0&#039;;
+    }
+
+    return $val;
+  }
+
+  /**
+   * MSIE Filter Conversion
+   *
+   * @param (string) prop: Current Property
+   * @param (string) val: property value
+   */
+  private function filter( $prop, $val ) {
+    if ( preg_match( &quot;/filter/&quot;, $prop ) ) {
+      $val = preg_replace( $this-&gt;rfilter, &quot;alpha(opacity=$1)&quot;, $val );
+    }
+
+    return $val;
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Individuals Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Numeric.inc advagg_css_compress/css-compressor-3.x/src/lib/Numeric.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Numeric.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Numeric.inc	2012-03-23 13:02:19.000000000 -0600
@@ -5,97 +5,96 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Numeric
-{
-	/**
-	 * Numeric Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @param (array) options: Reference to options
-	 * @param (regex) rdecimal: Checks for zero decimal
-	 * @param (regex) rzero: Checks for preceding 0 to decimal unit
-	 * @param (regex) runit: Checks for suffix on 0 unit
-	 */
-	private $Control;
-	private $options = array();
-	private $rdecimal = &quot;/^(\+|\-)?(\d*\.[1-9]*0*)(\%|[a-z]{2})$/i&quot;;
-	private $rzero = &quot;/^(\+|\-)?0(\.\d+)(\%|[a-z]{2})?$/i&quot;;
-	private $runit = &quot;/^0(\%|[a-z]{2})$/i&quot;;
-
-	/**
-	 * Stash a reference to the controller on each instantiation
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 */
-	public function __construct( CSSCompression_Control $control ) {
-		$this-&gt;Control = $control;
-		$this-&gt;options = &amp;$control-&gt;Option-&gt;options;
-	}
-
-	/**
-	 * Runs all numeric operations
-	 *
-	 * @param (string) str: Unit string
-	 */
-	public function numeric( $str ) {
-		$str = $this-&gt;decimal( $str );
-		$str = $this-&gt;zeroes( $str );
-		$str = $this-&gt;units( $str );
-		return $str;
-	}
-
-	/**
-	 * Remove&#039;s unecessary decimal, ie 13.0px =&gt; 13px
-	 *
-	 * @param (string) str: Unit string
-	 */
-	private function decimal( $str ) {
-		if ( preg_match( $this-&gt;rdecimal, $str, $match ) ) {
-			$str = ( $match[ 1 ] == &#039;-&#039; ? &#039;-&#039; : &#039;&#039; ) . floatval( $match[ 2 ] ) . $match[ 3 ];
-		}
-
-		return $str;
-	}
-
-	/**
-	 * Removes suffix from 0 unit, ie 0px; =&gt; 0;
-	 *
-	 * @param (string) str: Unit string
-	 */
-	private function units( $str ) {
-		if ( preg_match( $this-&gt;runit, $str, $match ) ) {
-			$str = &#039;0&#039;;
-		}
-
-		return $str;
-	}
-
-
-	/**
-	 * Removes leading zero in decimal, ie 0.33px =&gt; .33px
-	 *
-	 * @param (string) str: Unit string
-	 */
-	private function zeroes( $str ) {
-		if ( preg_match( $this-&gt;rzero, $str, $match ) ) {
-			$str = ( isset( $match[ 1 ] ) &amp;&amp; $match[ 1 ] == &#039;-&#039; ? &#039;-&#039; : &#039;&#039; ) . $match[ 2 ] . ( isset( $match[ 3 ] ) ? $match[ 3 ] : &#039;&#039; );
-		}
-
-		return $str;
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Numeric Class - &quot; . $method );
-		}
-	}
-};
+class CSSCompression_Numeric {
+  /**
+   * Numeric Patterns
+   *
+   * @class Control: Compression Controller
+   * @param (array) options: Reference to options
+   * @param (regex) rdecimal: Checks for zero decimal
+   * @param (regex) rzero: Checks for preceding 0 to decimal unit
+   * @param (regex) runit: Checks for suffix on 0 unit
+   */
+  private $Control;
+  private $options = array();
+  private $rdecimal = &quot;/^(\+|\-)?(\d*\.[1-9]*0*)(\%|[a-z]{2})$/i&quot;;
+  private $rzero = &quot;/^(\+|\-)?0(\.\d+)(\%|[a-z]{2})?$/i&quot;;
+  private $runit = &quot;/^0(\%|[a-z]{2})$/i&quot;;
+
+  /**
+   * Stash a reference to the controller on each instantiation
+   *
+   * @param (class) control: CSSCompression Controller
+   */
+  public function __construct( CSSCompression_Control $control ) {
+    $this-&gt;Control = $control;
+    $this-&gt;options = &amp;$control-&gt;Option-&gt;options;
+  }
+
+  /**
+   * Runs all numeric operations
+   *
+   * @param (string) str: Unit string
+   */
+  public function numeric( $str ) {
+    $str = $this-&gt;decimal( $str );
+    $str = $this-&gt;zeroes( $str );
+    $str = $this-&gt;units( $str );
+    return $str;
+  }
+
+  /**
+   * Remove&#039;s unecessary decimal, ie 13.0px =&gt; 13px
+   *
+   * @param (string) str: Unit string
+   */
+  private function decimal( $str ) {
+    if ( preg_match( $this-&gt;rdecimal, $str, $match ) ) {
+      $str = ( $match[1] == &#039;-&#039; ? &#039;-&#039; : &#039;&#039; ) . floatval( $match[2] ) . $match[3];
+    }
+
+    return $str;
+  }
+
+  /**
+   * Removes suffix from 0 unit, ie 0px; =&gt; 0;
+   *
+   * @param (string) str: Unit string
+   */
+  private function units( $str ) {
+    if ( preg_match( $this-&gt;runit, $str, $match ) ) {
+      $str = &#039;0&#039;;
+    }
+
+    return $str;
+  }
+
+
+  /**
+   * Removes leading zero in decimal, ie 0.33px =&gt; .33px
+   *
+   * @param (string) str: Unit string
+   */
+  private function zeroes( $str ) {
+    if ( preg_match( $this-&gt;rzero, $str, $match ) ) {
+      $str = ( isset( $match[1] ) &amp;&amp; $match[1] == &#039;-&#039; ? &#039;-&#039; : &#039;&#039; ) . $match[2] . ( isset( $match[3] ) ? $match[3] : &#039;&#039; );
+    }
+
+    return $str;
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Numeric Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Option.inc advagg_css_compress/css-compressor-3.x/src/lib/Option.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Option.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Option.inc	2012-03-23 13:02:19.000000000 -0600
@@ -5,127 +5,126 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Option
-{
-	/**
-	 * Option Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @param (string) custom: Name of the custom mode
-	 * @param (array) options: Instance settings
-	 */
-	private $Control;
-	private $custom = &#039;__custom&#039;;
-	public $options = array();
-
-	/**
-	 * Stash a reference to the controller on each instantiation
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 */
-	public function __construct( CSSCompression_Control $control ) {
-		$this-&gt;Control = $control;
-		$this-&gt;options = CSSCompression::$defaults;
-		$control-&gt;mode = $this-&gt;custom;
-	}
-
-	/**
-	 * Maintainable access to the options array
-	 *
-	 *	- Passing no arguments returns the entire options array
-	 *	- Passing a single name argument returns the value for the option
-	 * 	- Passing both a name and value, sets the value to the name key, and returns the value
-	 *	- Passing an array will merge the options with the array passed, for object like extension
-	 *
-	 * @param (mixed) name: The key name of the option
-	 * @param (mixed) value: Value to set the option
-	 */
-	public function option( $name = NULL, $value = NULL ) {
-		if ( $name === NULL ) {
-			return $this-&gt;options;
-		}
-		else if ( is_array( $name ) ) {
-			return $this-&gt;merge( $name );
-		}
-		else if ( $value === NULL ) {
-			return isset( $this-&gt;options[ $name ] ) ? $this-&gt;options[ $name ] : NULL;
-		}
-		else {
-			// Readability doesn&#039;t signify custom settings
-			if ( $name != &#039;readability&#039; ) {
-				$this-&gt;Control-&gt;mode = $this-&gt;custom;
-			}
-
-			return ( $this-&gt;options[ $name ] = $value );
-		}
-	}
-
-	/**
-	 * Reset&#039;s the default options
-	 *
-	 * @params none;
-	 */
-	public function reset(){
-		// Reset and return the new options
-		return $this-&gt;options = CSSCompression::$defaults;
-	}
-
-	/**
-	 * Extend like function to merge an array of preferences into
-	 * the options array.
-	 *
-	 * @param (mixed) options: Array of preferences to merge into options
-	 */
-	public function merge( $options = array() ) {
-		$modes = CSSCompression::modes();
-		if ( $options &amp;&amp; is_array( $options ) &amp;&amp; count( $options ) ) {
-			$this-&gt;Control-&gt;mode = $this-&gt;custom;
-			foreach ( $this-&gt;options as $key =&gt; $value ) {
-				if ( ! isset( $options[ $key ] ) ) {
-					continue;
-				}
-				else if ( strtolower( $options[ $key ] ) == &#039;on&#039; ) {
-					$this-&gt;options[ $key ] = true;
-				}
-				else if ( strtolower( $options[ $key ] ) == &#039;off&#039; ) {
-					$this-&gt;options[ $key ] = false;
-				}
-				else {
-					$this-&gt;options[ $key ] = intval( $options[ $key ] );
-				}
-			}
-		}
-		else if ( $options &amp;&amp; is_string( $options ) &amp;&amp; array_key_exists( $options, $modes ) ) {
-			$this-&gt;Control-&gt;mode = $options;
-
-			// Default all to true, the mode has to force false
-			foreach ( $this-&gt;options as $key =&gt; $value ) {
-				if ( $key != &#039;readability&#039; ) {
-					$this-&gt;options[ $key ] = true;
-				}
-			}
-
-			// Merge mode into options
-			foreach ( $modes[ $options ] as $key =&gt; $value ) {
-				$this-&gt;options[ $key ] = $value;
-			}
-		}
-
-		return $this-&gt;options;
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Option Class - &quot; . $method );
-		}
-	}
-};
+class CSSCompression_Option {
+  /**
+   * Option Patterns
+   *
+   * @class Control: Compression Controller
+   * @param (string) custom: Name of the custom mode
+   * @param (array) options: Instance settings
+   */
+  private $Control;
+  private $custom = &#039;__custom&#039;;
+  public $options = array();
+
+  /**
+   * Stash a reference to the controller on each instantiation
+   *
+   * @param (class) control: CSSCompression Controller
+   */
+  public function __construct( CSSCompression_Control $control ) {
+    $this-&gt;Control = $control;
+    $this-&gt;options = CSSCompression::$defaults;
+    $control-&gt;mode = $this-&gt;custom;
+  }
+
+  /**
+   * Maintainable access to the options array
+   *
+   *	- Passing no arguments returns the entire options array
+   *	- Passing a single name argument returns the value for the option
+   * 	- Passing both a name and value, sets the value to the name key, and returns the value
+   *	- Passing an array will merge the options with the array passed, for object like extension
+   *
+   * @param (mixed) name: The key name of the option
+   * @param (mixed) value: Value to set the option
+   */
+  public function option( $name = NULL, $value = NULL ) {
+    if ( $name === NULL ) {
+      return $this-&gt;options;
+    }
+    else if ( is_array( $name ) ) {
+      return $this-&gt;merge( $name );
+    }
+    else if ( $value === NULL ) {
+      return isset( $this-&gt;options[$name] ) ? $this-&gt;options[$name] : NULL;
+    }
+    else {
+      // Readability doesn&#039;t signify custom settings
+      if ( $name != &#039;readability&#039; ) {
+        $this-&gt;Control-&gt;mode = $this-&gt;custom;
+      }
+
+      return ( $this-&gt;options[$name] = $value );
+    }
+  }
+
+  /**
+   * Reset&#039;s the default options
+   *
+   * @params none;
+   */
+  public function reset() {
+    // Reset and return the new options
+    return $this-&gt;options = CSSCompression::$defaults;
+  }
+
+  /**
+   * Extend like function to merge an array of preferences into
+   * the options array.
+   *
+   * @param (mixed) options: Array of preferences to merge into options
+   */
+  public function merge( $options = array() ) {
+    $modes = CSSCompression::modes();
+    if ( $options &amp;&amp; is_array( $options ) &amp;&amp; count( $options ) ) {
+      $this-&gt;Control-&gt;mode = $this-&gt;custom;
+      foreach ( $this-&gt;options as $key =&gt; $value ) {
+        if ( ! isset( $options[$key] ) ) {
+          continue;
+        }
+        else if ( strtolower( $options[$key] ) == &#039;on&#039; ) {
+          $this-&gt;options[$key] = true;
+        }
+        else if ( strtolower( $options[$key] ) == &#039;off&#039; ) {
+          $this-&gt;options[$key] = false;
+        }
+        else {
+          $this-&gt;options[$key] = intval( $options[$key] );
+        }
+      }
+    }
+    else if ( $options &amp;&amp; is_string( $options ) &amp;&amp; array_key_exists( $options, $modes ) ) {
+      $this-&gt;Control-&gt;mode = $options;
+
+      // Default all to true, the mode has to force false
+      foreach ( $this-&gt;options as $key =&gt; $value ) {
+        if ( $key != &#039;readability&#039; ) {
+          $this-&gt;options[$key] = true;
+        }
+      }
+
+      // Merge mode into options
+      foreach ( $modes[$options] as $key =&gt; $value ) {
+        $this-&gt;options[$key] = $value;
+      }
+    }
+
+    return $this-&gt;options;
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Option Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Organize.inc advagg_css_compress/css-compressor-3.x/src/lib/Organize.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Organize.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Organize.inc	2012-03-23 13:02:19.000000000 -0600
@@ -5,143 +5,142 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Organize
-{
-	/**
-	 * Organize Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @param (array) options: Reference to options
-	 * @param (regex) rsemicolon: Checks for semicolon without an escape &#039;\&#039; character before it
-	 * @param (regex) rlastsemi: Checks for semicolon at the end of the string
-	 */
-	private $Control;
-	private $options = array();
-	private $rsemicolon = &quot;/(?&lt;!\\\);/&quot;;
-	private $rlastsemi = &quot;/(?&lt;!\\\);$/&quot;;
-
-	/**
-	 * Stash a reference to the controller on each instantiation
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 */
-	public function __construct( CSSCompression_Control $control ) {
-		$this-&gt;Control = $control;
-		$this-&gt;options = &amp;$control-&gt;Option-&gt;options;
-	}
-
-	/**
-	 * Look to see if we can combine selectors to reduce the number
-	 * of definitions.
-	 *
-	 * @param (array) selectors: Array of selectors, map directly to details
-	 * @param (array) details: Array of rule sets, map directly to selectors
-	 */
-	public function organize( &amp;$selectors = array(), &amp;$details = array() ) {
-		// Combining defns based on similar selectors
-		list ( $selectors, $details ) = $this-&gt;reduceSelectors( $selectors, $details );
-
-		// Combining defns based on similar details
-		list ( $selectors, $details ) = $this-&gt;reduceDetails( $selectors, $details );
-
-		// Return in package form
-		return array( $selectors, $details );
-	}
-
-	/**
-	 * Combines multiply defined selectors by merging the rule sets,
-	 * latter declarations overide declaratins at top of file
-	 *
-	 * @param (array) selectors: Array of selectors broken down by setup
-	 * @param (array) details: Array of rule sets broken down by setup
-	 */
-	private function reduceSelectors( $selectors, $details ) {
-		$keys = array_keys( $selectors );
-		$max = array_pop( $keys ) + 1;
-
-		for ( $i = 0; $i &lt; $max; $i++ ) {
-			if ( ! isset( $selectors[ $i ] ) ) {
-				continue;
-			}
-
-			for ( $k = $i + 1; $k &lt; $max; $k++ ) {
-				if ( ! isset( $selectors[ $k ] ) ) {
-					continue;
-				}
-
-				if ( $selectors[ $i ] == $selectors[ $k ] ) {
-					// Prevent noticies
-					if ( ! isset( $details[ $i ] ) ) {
-						$details[ $i ] = &#039;&#039;;
-					}
-					if ( ! isset( $details[ $k ] ) ) {
-						$details[ $k ] = &#039;&#039;;
-					}
-
-					// We kill the last semicolon before organization, so account for that.
-					if ( $details[ $i ] != &#039;&#039; &amp;&amp; $details[ $k ] != &#039;&#039; &amp;&amp; ! preg_match( $this-&gt;rlastsemi, $details[ $i ] ) ) {
-						$details[ $i ] .= &#039;;&#039; . $details[ $k ];
-					}
-					else {
-						$details[ $i ] .= $details[ $k ];
-					}
-
-					// Remove the second part
-					unset( $selectors[ $k ], $details[ $k ] );
-				}
-			}
-		}
-
-		return array( $selectors, $details );
-	}
-
-	/**
-	 * Combines multiply defined rule sets by merging the selectors
-	 * in comma seperated format
-	 *
-	 * @param (array) selectors: Array of selectors broken down by setup
-	 * @param (array) details: Array of rule sets broken down by setup
-	 */
-	private function reduceDetails( $selectors, $details ) {
-		$keys = array_keys( $selectors );
-		$max = array_pop( $keys ) + 1;
-		for ( $i = 0; $i &lt; $max; $i++ ) {
-			if ( ! isset( $selectors[ $i ] ) ) {
-				continue;
-			}
-
-			$arr = preg_split( $this-&gt;rsemicolon, isset( $details[ $i ] ) ? $details[ $i ] : &#039;&#039; );
-			for ( $k = $i + 1; $k &lt; $max; $k++ ) {
-				if ( ! isset( $selectors[ $k ] ) ) {
-					continue;
-				}
-
-				$match = preg_split( $this-&gt;rsemicolon, isset( $details[ $k ] ) ? $details[ $k ] : &#039;&#039; );
-				$x = array_diff( $arr, $match );
-				$y = array_diff( $match, $arr );
-
-				if ( count( $x ) &lt; 1 &amp;&amp; count( $y ) &lt; 1 ) {
-					$selectors[ $i ] .= &#039;,&#039; . $selectors[ $k ];
-					unset( $details[ $k ], $selectors[ $k ] );
-				}
-			}
-		}
-
-		return array( $selectors, $details );
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Organize Class - &quot; . $method );
-		}
-	}
-};
+class CSSCompression_Organize {
+  /**
+   * Organize Patterns
+   *
+   * @class Control: Compression Controller
+   * @param (array) options: Reference to options
+   * @param (regex) rsemicolon: Checks for semicolon without an escape &#039;\&#039; character before it
+   * @param (regex) rlastsemi: Checks for semicolon at the end of the string
+   */
+  private $Control;
+  private $options = array();
+  private $rsemicolon = &quot;/(?&lt;!\\\);/&quot;;
+  private $rlastsemi = &quot;/(?&lt;!\\\);$/&quot;;
+
+  /**
+   * Stash a reference to the controller on each instantiation
+   *
+   * @param (class) control: CSSCompression Controller
+   */
+  public function __construct( CSSCompression_Control $control ) {
+    $this-&gt;Control = $control;
+    $this-&gt;options = &amp;$control-&gt;Option-&gt;options;
+  }
+
+  /**
+   * Look to see if we can combine selectors to reduce the number
+   * of definitions.
+   *
+   * @param (array) selectors: Array of selectors, map directly to details
+   * @param (array) details: Array of rule sets, map directly to selectors
+   */
+  public function organize( &amp;$selectors = array(), &amp;$details = array() ) {
+    // Combining defns based on similar selectors
+    list( $selectors, $details ) = $this-&gt;reduceSelectors( $selectors, $details );
+
+    // Combining defns based on similar details
+    list( $selectors, $details ) = $this-&gt;reduceDetails( $selectors, $details );
+
+    // Return in package form
+    return array($selectors, $details);
+  }
+
+  /**
+   * Combines multiply defined selectors by merging the rule sets,
+   * latter declarations overide declaratins at top of file
+   *
+   * @param (array) selectors: Array of selectors broken down by setup
+   * @param (array) details: Array of rule sets broken down by setup
+   */
+  private function reduceSelectors( $selectors, $details ) {
+    $keys = array_keys( $selectors );
+    $max = array_pop( $keys ) + 1;
+
+    for ( $i = 0; $i &lt; $max; $i++ ) {
+      if ( ! isset( $selectors[$i] ) ) {
+        continue;
+      }
+
+      for ( $k = $i + 1; $k &lt; $max; $k++ ) {
+        if ( ! isset( $selectors[$k] ) ) {
+          continue;
+        }
+
+        if ( $selectors[$i] == $selectors[$k] ) {
+          // Prevent noticies
+          if ( ! isset( $details[$i] ) ) {
+            $details[$i] = &#039;&#039;;
+          }
+          if ( ! isset( $details[$k] ) ) {
+            $details[$k] = &#039;&#039;;
+          }
+
+          // We kill the last semicolon before organization, so account for that.
+          if ( $details[$i] != &#039;&#039; &amp;&amp; $details[$k] != &#039;&#039; &amp;&amp; ! preg_match( $this-&gt;rlastsemi, $details[$i] ) ) {
+            $details[$i] .= &#039;;&#039; . $details[$k];
+          }
+          else {
+            $details[$i] .= $details[$k];
+          }
+
+          // Remove the second part
+          unset( $selectors[$k], $details[$k] );
+        }
+      }
+    }
+
+    return array($selectors, $details);
+  }
+
+  /**
+   * Combines multiply defined rule sets by merging the selectors
+   * in comma seperated format
+   *
+   * @param (array) selectors: Array of selectors broken down by setup
+   * @param (array) details: Array of rule sets broken down by setup
+   */
+  private function reduceDetails( $selectors, $details ) {
+    $keys = array_keys( $selectors );
+    $max = array_pop( $keys ) + 1;
+    for ( $i = 0; $i &lt; $max; $i++ ) {
+      if ( ! isset( $selectors[$i] ) ) {
+        continue;
+      }
+
+      $arr = preg_split( $this-&gt;rsemicolon, isset( $details[$i] ) ? $details[$i] : &#039;&#039; );
+      for ( $k = $i + 1; $k &lt; $max; $k++ ) {
+        if ( ! isset( $selectors[$k] ) ) {
+          continue;
+        }
+
+        $match = preg_split( $this-&gt;rsemicolon, isset( $details[$k] ) ? $details[$k] : &#039;&#039; );
+        $x = array_diff( $arr, $match );
+        $y = array_diff( $match, $arr );
+
+        if ( count( $x ) &lt; 1 &amp;&amp; count( $y ) &lt; 1 ) {
+          $selectors[$i] .= &#039;,&#039; . $selectors[$k];
+          unset( $details[$k], $selectors[$k] );
+        }
+      }
+    }
+
+    return array($selectors, $details);
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Organize Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Selectors.inc advagg_css_compress/css-compressor-3.x/src/lib/Selectors.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Selectors.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Selectors.inc	2012-03-23 13:02:19.000000000 -0600
@@ -5,239 +5,238 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Selectors
-{
-	/**
-	 * Selector patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @param (string) token: Copy of the injection token
-	 * @param (regex) ridattr: ID Attribute matcher (combined with token)
-	 * @param (regex) rclassattr: class Attribute matcher (combined with token)
-	 * @param (array) options: Reference to options
-	 * @param (regex) rmark: Stop points during selector parsing
-	 * @param (regex) ridclassend: End of a id/class string
-	 * @param (regex) rescapedspace: for replacement in class attributes
-	 * @param (regex) rquote: Checks for the next quote character
-	 * @param (regex) rcomma: looks for an unescaped comma character
-	 * @param (regex) rspace: looks for an unescaped space character
-	 * @param (regex) rid: looks for an unescaped hash character
-	 * @param (regex) rpseudo: Add space after first-letter|line pseudo selector
-	 * --- when it occurs before comma or rule set
-	 */
-	private $Control;
-	private $token = &#039;&#039;;
-	private $ridattr = &quot;&quot;;
-	private $rclassattr = &quot;&quot;;
-	private $options = array();
-	private $rmark = &quot;/(?&lt;!\\\)(#|\.|=)/&quot;;
-	private $ridclassend = &quot;/(?&lt;!\\\)[:#&gt;~\[\+\*\. ]/&quot;;
-	private $rquote = &quot;/(?&lt;!\\\)(\&quot;|&#039;)?\]/&quot;;
-	private $rescapedspace = &quot;/\\\ /&quot;;
-	private $rcomma = &quot;/(?&lt;!\\\),/&quot;;
-	private $rspace = &quot;/(?&lt;!\\\)\s/&quot;;
-	private $rid = &quot;/(?&lt;!\\\)#/&quot;;
-	private $rpseudo = &quot;/:first-(letter|line)(,|$)/i&quot;;
-
-	/**
-	 * Stash a reference to the controller on each instantiation
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 */
-	public function __construct( CSSCompression_Control $control ) {
-		$this-&gt;Control = $control;
-		$this-&gt;token = CSSCompression::TOKEN;
-		$this-&gt;ridattr = &quot;/\[id=$this-&gt;token(.*?)$this-&gt;token\]/&quot;;
-		$this-&gt;rclassattr = &quot;/\[class=$this-&gt;token(.*?)$this-&gt;token\]/&quot;;
-		$this-&gt;options = &amp;$control-&gt;Option-&gt;options;
-	}
-
-	/**
-	 * Selector specific optimizations
-	 *
-	 * @param (array) selectors: Array of selectors
-	 */
-	public function selectors( &amp;$selectors = array() ) {
-		foreach ( $selectors as &amp;$selector ) {
-			// Auto ignore sections
-			if ( strpos( $selector, $this-&gt;token ) === 0 ) {
-				continue;
-			}
-
-			// Smart casing and token injection
-			$selector = $this-&gt;parse( $selector );
-
-			// Converting attr to shorthanded selectors
-			if ( $this-&gt;options[&#039;attr2selector&#039;] ) {
-				// Use id hash instead of id attr
-				$selector = $this-&gt;idAttribute( $selector );
-
-				// Use class notation instead of class attr
-				$selector = $this-&gt;classAttribute( $selector );
-			}
-
-			// Remove everything before final id in a selector
-			if ( $this-&gt;options[&#039;strict-id&#039;] ) {
-				$selector = $this-&gt;strictid( $selector );
-			}
-
-			// Get rid of possible repeated selectors
-			$selector = $this-&gt;repeats( $selector );
-
-			// Add space after pseudo selectors (so ie6 doesn&#039;t complain)
-			if ( $this-&gt;options[&#039;pseudo-space&#039;] ) {
-				$selector = $this-&gt;pseudoSpace( $selector );
-			}
-		}
-
-		return $selectors;
-	}
-
-	/**
-	 * Converts selectors like BODY =&gt; body, DIV =&gt; div
-	 * and injects tokens wrappers for attribute values
-	 *
-	 * @param (string) selector: CSS Selector
-	 */
-	private function parse( $selector ) {
-		$clean = &#039;&#039;;
-		$substr = &#039;&#039;;
-		$pos = 0;
-
-		while ( preg_match( $this-&gt;rmark, $selector, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			$substr = substr( $selector, $pos, $match[ 0 ][ 1 ] + 1 - $pos );
-			$clean .= $this-&gt;options[&#039;lowercase-selectors&#039;] ? strtolower( $substr ) : $substr;
-			$pos = $match[ 0 ][ 1 ] + strlen( $match[ 1 ][ 0 ] );
-
-			// Class or id match
-			if ( $match[ 1 ][ 0 ] == &#039;#&#039; || $match[ 1 ][ 0 ] == &#039;.&#039; ) {
-				if ( preg_match( $this-&gt;ridclassend, $selector, $m, PREG_OFFSET_CAPTURE, $pos ) ) {
-					$clean .= substr( $selector, $pos, $m[ 0 ][ 1 ] - $pos );
-					$pos = $m[ 0 ][ 1 ];
-				}
-				else {
-					$clean .= substr( $selector, $pos );
-					$pos = strlen( $selector );
-					break;
-				}
-			}
-			// Start of a string
-			else if ( preg_match( $this-&gt;rquote, $selector, $m, PREG_OFFSET_CAPTURE, $pos ) ) {
-				if ( $selector[ $pos ] == &quot;\&quot;&quot; || $selector[ $pos ] == &quot;&#039;&quot; ) {
-					$pos++;
-				}
-				$clean .= $this-&gt;token . substr( $selector, $pos, $m[ 0 ][ 1 ] - $pos ) . $this-&gt;token . &#039;]&#039;;
-				$pos = $m[ 0 ][ 1 ] + strlen( $m[ 0 ][ 0 ] );
-			}
-			// No break points left
-			else {
-				$clean .= substr( $selector, $pos );
-				$pos = strlen( $selector );
-				break;
-			}
-		}
-
-		return $clean . ( $this-&gt;options[&#039;lowercase-selectors&#039;] ? strtolower( substr( $selector, $pos ) ) : substr( $selector, $pos ) );
-	}
-
-	/**
-	 * Convert [id=blah] attribute selectors into id form selector (#blah)
-	 *
-	 * @param (string) selector: CSS Selector
-	 */
-	private function idAttribute( $selector ) {
-		$pos = 0;
-		while ( preg_match( $this-&gt;ridattr, $selector, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			// Don&#039;t convert if space found (not valid hash selector)
-			if ( strpos( $match[ 1 ][ 0 ], &#039; &#039; ) !== false ) {
-				$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] );
-				continue;
-			}
-
-			$selector = substr_replace( $selector, &#039;#&#039; . $match[ 1 ][ 0 ], $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
-			$pos = $match[ 0 ][ 1 ] + strlen( $match[ 1 ][ 0 ] ) + 1;
-		}
-
-		return $selector;
-	}
-
-	/**
-	 * Convert [class=blah] attribute selectors into class form selector (.blah)
-	 *
-	 * @param (string) selector: CSS Selector
-	 */
-	private function classAttribute( $selector ) {
-		$pos = 0;
-		while ( preg_match( $this-&gt;rclassattr, $selector, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			// Don&#039;t convert if prescense of dot separator found
-			if ( strpos( $match[ 1 ][ 0 ], &#039;.&#039; ) !== false ) {
-				$pos = $match[ 0 ][ 1 ] + strlen( $match[ 0 ][ 0 ] );
-				continue;
-			}
-
-			$replace = &#039;.&#039; . preg_replace( $this-&gt;rescapedspace, &quot;.&quot;, $match[ 1 ][ 0 ] );
-			$selector = substr_replace( $selector, $replace, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
-			$pos = $match[ 0 ][ 1 ] + strlen( $match[ 1 ][ 0 ] ) + 1;
-		}
-
-		return $selector;
-	}
-
-	/**
-	 * Promotes nested id&#039;s to the front of the selector
-	 *
-	 * @param (string) selector: CSS Selector
-	 */
-	private function strictid( $selector ) {
-		$parts = preg_split( $this-&gt;rcomma, $selector );
-		foreach ( $parts as &amp;$s ) {
-			if ( preg_match( $this-&gt;rid, $s ) ) {
-				$p = preg_split( $this-&gt;rid, $s );
-				$s = &#039;#&#039; . array_pop( $p );
-			}
-		}
-
-		return implode( &#039;,&#039;, $parts );
-	}
-
-	/**
-	 * Removes repeated selectors that have been comma separated
-	 *
-	 * @param (string) selector: CSS Selector
-	 */
-	private function repeats( $selector ) {
-		$parts = preg_split( $this-&gt;rcomma, $selector );
-		$parts = array_flip( $parts );
-		$parts = array_flip( $parts );
-		return implode( &#039;,&#039;, $parts );
-	}
-
-	/**
-	 * Adds space after pseudo selector for ie6 like a:first-child{ =&gt; a:first-child {
-	 *
-	 * @param (string) selector: CSS Selector
-	 */
-	private function pseudoSpace( $selector ) {
-		return preg_replace( $this-&gt;rpseudo, &quot;:first-$1 $2&quot;, $selector );
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			if ( $method == &#039;selectors&#039; ) {
-				return $this-&gt;selectors( $args[ 0 ] );
-			}
-			else {
-				return call_user_func_array( array( $this, $method ), $args );
-			}
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Selectors Class - &quot; . $method );
-		}
-	}
-};
+class CSSCompression_Selectors {
+  /**
+   * Selector patterns
+   *
+   * @class Control: Compression Controller
+   * @param (string) token: Copy of the injection token
+   * @param (regex) ridattr: ID Attribute matcher (combined with token)
+   * @param (regex) rclassattr: class Attribute matcher (combined with token)
+   * @param (array) options: Reference to options
+   * @param (regex) rmark: Stop points during selector parsing
+   * @param (regex) ridclassend: End of a id/class string
+   * @param (regex) rescapedspace: for replacement in class attributes
+   * @param (regex) rquote: Checks for the next quote character
+   * @param (regex) rcomma: looks for an unescaped comma character
+   * @param (regex) rspace: looks for an unescaped space character
+   * @param (regex) rid: looks for an unescaped hash character
+   * @param (regex) rpseudo: Add space after first-letter|line pseudo selector
+   * --- when it occurs before comma or rule set
+   */
+  private $Control;
+  private $token = &#039;&#039;;
+  private $ridattr = &quot;&quot;;
+  private $rclassattr = &quot;&quot;;
+  private $options = array();
+  private $rmark = &quot;/(?&lt;!\\\)(#|\.|=)/&quot;;
+  private $ridclassend = &quot;/(?&lt;!\\\)[:#&gt;~\[\+\*\. ]/&quot;;
+  private $rquote = &quot;/(?&lt;!\\\)(\&quot;|&#039;)?\]/&quot;;
+  private $rescapedspace = &quot;/\\\ /&quot;;
+  private $rcomma = &quot;/(?&lt;!\\\),/&quot;;
+  private $rspace = &quot;/(?&lt;!\\\)\s/&quot;;
+  private $rid = &quot;/(?&lt;!\\\)#/&quot;;
+  private $rpseudo = &quot;/:first-(letter|line)(,|$)/i&quot;;
+
+  /**
+   * Stash a reference to the controller on each instantiation
+   *
+   * @param (class) control: CSSCompression Controller
+   */
+  public function __construct( CSSCompression_Control $control ) {
+    $this-&gt;Control = $control;
+    $this-&gt;token = CSSCompression::TOKEN;
+    $this-&gt;ridattr = &quot;/\[id=$this-&gt;token(.*?)$this-&gt;token\]/&quot;;
+    $this-&gt;rclassattr = &quot;/\[class=$this-&gt;token(.*?)$this-&gt;token\]/&quot;;
+    $this-&gt;options = &amp;$control-&gt;Option-&gt;options;
+  }
+
+  /**
+   * Selector specific optimizations
+   *
+   * @param (array) selectors: Array of selectors
+   */
+  public function selectors( &amp;$selectors = array() ) {
+    foreach ( $selectors as &amp;$selector ) {
+      // Auto ignore sections
+      if ( strpos( $selector, $this-&gt;token ) === 0 ) {
+        continue;
+      }
+
+      // Smart casing and token injection
+      $selector = $this-&gt;parse( $selector );
+
+      // Converting attr to shorthanded selectors
+      if ( $this-&gt;options[&#039;attr2selector&#039;] ) {
+        // Use id hash instead of id attr
+        $selector = $this-&gt;idAttribute( $selector );
+
+        // Use class notation instead of class attr
+        $selector = $this-&gt;classAttribute( $selector );
+      }
+
+      // Remove everything before final id in a selector
+      if ( $this-&gt;options[&#039;strict-id&#039;] ) {
+        $selector = $this-&gt;strictid( $selector );
+      }
+
+      // Get rid of possible repeated selectors
+      $selector = $this-&gt;repeats( $selector );
+
+      // Add space after pseudo selectors (so ie6 doesn&#039;t complain)
+      if ( $this-&gt;options[&#039;pseudo-space&#039;] ) {
+        $selector = $this-&gt;pseudoSpace( $selector );
+      }
+    }
+
+    return $selectors;
+  }
+
+  /**
+   * Converts selectors like BODY =&gt; body, DIV =&gt; div
+   * and injects tokens wrappers for attribute values
+   *
+   * @param (string) selector: CSS Selector
+   */
+  private function parse( $selector ) {
+    $clean = &#039;&#039;;
+    $substr = &#039;&#039;;
+    $pos = 0;
+
+    while ( preg_match( $this-&gt;rmark, $selector, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      $substr = substr( $selector, $pos, $match[0][1] + 1 - $pos );
+      $clean .= $this-&gt;options[&#039;lowercase-selectors&#039;] ? strtolower( $substr ) : $substr;
+      $pos = $match[0][1] + strlen( $match[1][0] );
+
+      // Class or id match
+      if ( $match[1][0] == &#039;#&#039; || $match[1][0] == &#039;.&#039; ) {
+        if ( preg_match( $this-&gt;ridclassend, $selector, $m, PREG_OFFSET_CAPTURE, $pos ) ) {
+          $clean .= substr( $selector, $pos, $m[0][1] - $pos );
+          $pos = $m[0][1];
+        }
+        else {
+          $clean .= substr( $selector, $pos );
+          $pos = strlen( $selector );
+          break;
+        }
+      }
+      // Start of a string
+      else if ( preg_match( $this-&gt;rquote, $selector, $m, PREG_OFFSET_CAPTURE, $pos ) ) {
+        if ( $selector[$pos] == &quot;\&quot;&quot; || $selector[$pos] == &quot;&#039;&quot; ) {
+          $pos++;
+        }
+        $clean .= $this-&gt;token . substr( $selector, $pos, $m[0][1] - $pos ) . $this-&gt;token . &#039;]&#039;;
+        $pos = $m[0][1] + strlen( $m[0][0] );
+      }
+      // No break points left
+      else {
+        $clean .= substr( $selector, $pos );
+        $pos = strlen( $selector );
+        break;
+      }
+    }
+
+    return $clean . ( $this-&gt;options[&#039;lowercase-selectors&#039;] ? strtolower( substr( $selector, $pos ) ) : substr( $selector, $pos ) );
+  }
+
+  /**
+   * Convert [id=blah] attribute selectors into id form selector (#blah)
+   *
+   * @param (string) selector: CSS Selector
+   */
+  private function idAttribute( $selector ) {
+    $pos = 0;
+    while ( preg_match( $this-&gt;ridattr, $selector, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      // Don&#039;t convert if space found (not valid hash selector)
+      if ( strpos( $match[1][0], &#039; &#039; ) !== false ) {
+        $pos = $match[0][1] + strlen( $match[0][0] );
+        continue;
+      }
+
+      $selector = substr_replace( $selector, &#039;#&#039; . $match[1][0], $match[0][1], strlen( $match[0][0] ) );
+      $pos = $match[0][1] + strlen( $match[1][0] ) + 1;
+    }
+
+    return $selector;
+  }
+
+  /**
+   * Convert [class=blah] attribute selectors into class form selector (.blah)
+   *
+   * @param (string) selector: CSS Selector
+   */
+  private function classAttribute( $selector ) {
+    $pos = 0;
+    while ( preg_match( $this-&gt;rclassattr, $selector, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      // Don&#039;t convert if prescense of dot separator found
+      if ( strpos( $match[1][0], &#039;.&#039; ) !== false ) {
+        $pos = $match[0][1] + strlen( $match[0][0] );
+        continue;
+      }
+
+      $replace = &#039;.&#039; . preg_replace( $this-&gt;rescapedspace, &quot;.&quot;, $match[1][0] );
+      $selector = substr_replace( $selector, $replace, $match[0][1], strlen( $match[0][0] ) );
+      $pos = $match[0][1] + strlen( $match[1][0] ) + 1;
+    }
+
+    return $selector;
+  }
+
+  /**
+   * Promotes nested id&#039;s to the front of the selector
+   *
+   * @param (string) selector: CSS Selector
+   */
+  private function strictid( $selector ) {
+    $parts = preg_split( $this-&gt;rcomma, $selector );
+    foreach ( $parts as &amp;$s ) {
+      if ( preg_match( $this-&gt;rid, $s ) ) {
+        $p = preg_split( $this-&gt;rid, $s );
+        $s = &#039;#&#039; . array_pop( $p );
+      }
+    }
+
+    return implode( &#039;,&#039;, $parts );
+  }
+
+  /**
+   * Removes repeated selectors that have been comma separated
+   *
+   * @param (string) selector: CSS Selector
+   */
+  private function repeats( $selector ) {
+    $parts = preg_split( $this-&gt;rcomma, $selector );
+    $parts = array_flip( $parts );
+    $parts = array_flip( $parts );
+    return implode( &#039;,&#039;, $parts );
+  }
+
+  /**
+   * Adds space after pseudo selector for ie6 like a:first-child{ =&gt; a:first-child {
+   *
+   * @param (string) selector: CSS Selector
+   */
+  private function pseudoSpace( $selector ) {
+    return preg_replace( $this-&gt;rpseudo, &quot;:first-$1 $2&quot;, $selector );
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      if ( $method == &#039;selectors&#039; ) {
+        return $this-&gt;selectors( $args[0] );
+      }
+      else {
+        return call_user_func_array( array($this, $method), $args );
+      }
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Selectors Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Setup.inc advagg_css_compress/css-compressor-3.x/src/lib/Setup.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Setup.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Setup.inc	2012-03-23 13:02:20.000000000 -0600
@@ -5,286 +5,285 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Setup
-{
-	/**
-	 * Trim Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @class Individuals: Individuals Instance
-	 * @instance instance: CSSCompression Instance
-	 * @param (string) token: Copy of the injection token
-	 * @param (array) options: Reference to options
-	 * @param (array) stats: Reference to stats
-	 * @param (regex) rsemicolon: Checks for semicolon without an escape &#039;\&#039; character before it
-	 * @param (regex) rcolon: Checks for colon without an escape &#039;\&#039; character before it
-	 * @param (regex) rbang: Checks for &#039;!&#039; without an escape &#039;\&#039; character before it
-	 * @param (regex) rspacebank: Checks for an unescaped space before a bang character
-	 * @param (regex) rliner: Matching known 1-line intros
-	 * @param (regex) rnested: Matching known subsection handlers
-	 * @param (regex) rurl: url wrapper matching
-	 * @param (regex) rsinglequote: Checks for unescaped escaped single quote (mouthfull)
-	 * @param (array) rsetup: Expanding stylesheet for semi-tokenizing
-	 */
-	private $Control;
-	private $Individuals;
-	private $instance;
-	private $token = &#039;&#039;;
-	private $options = array();
-	private $stats = array();
-	private $rsemicolon = &quot;/(?&lt;!\\\);/&quot;;
-	private $rcolon = &quot;/(?&lt;!\\\):/&quot;;
-	private $rbang = &quot;/(?&lt;!\\\)\!/&quot;;
-	private $rspacebang = &quot;/(?&lt;!\\\)\s\!/&quot;;
-	private $rliner = &quot;/^@(import|charset|namespace)/i&quot;;
-	private $rmedia = &quot;/^@media/i&quot;;
-	private $rurl = &quot;/url\((.*?)\)/&quot;;
-	private $rsinglequote = &quot;/(?&lt;!\\\)\\\&#039;/&quot;;
-	private $rsetup = array(
-		&#039;patterns&#039; =&gt; array(
-			&quot;/(?&lt;!\\\){/&quot;,
-			&quot;/(?&lt;!\\\)}/&quot;,
-			&quot;/(?&lt;!\\\)@/&quot;,
-			&quot;/(@(charset|import)[^;]*(?&lt;!\\\);)/&quot;,
-		),
-		&#039;replacements&#039; =&gt; array(
-			&quot;\n{\n&quot;,
-			&quot;\n}\n&quot;,
-			&quot;\n@&quot;,
-			&quot;$1\n&quot;,
-		),
-	);
-
-	/**
-	 * Stash a reference to the controller on each instantiation
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 */
-	public function __construct( CSSCompression_Control $control ) {
-		$this-&gt;Control = $control;
-		$this-&gt;Individuals = $control-&gt;Individuals;
-		$this-&gt;token = CSSCompression::TOKEN;
-		$this-&gt;options = &amp;$control-&gt;Option-&gt;options;
-		$this-&gt;stats = &amp;$control-&gt;stats;
-	}
-
-	/**
-	 * Setup selector and details arrays for compression methods
-	 *
-	 * @param (string) css: Trimed stylesheet
-	 */
-	public function setup( $css ) {
-		// Seperate the element from the elements details
-		$css = explode( &quot;\n&quot;, preg_replace( $this-&gt;rsetup[&#039;patterns&#039;], $this-&gt;rsetup[&#039;replacements&#039;], $css ) );
-		$newline = $this-&gt;options[&#039;readability&#039;] &gt; CSSCompression::READ_NONE ? &quot;\n&quot; : &#039;&#039;;
-		$setup = array(
-			&#039;selectors&#039; =&gt; array(),
-			&#039;details&#039; =&gt; array(),
-			&#039;unknown&#039; =&gt; array(),
-			&#039;introliner&#039; =&gt; &#039;&#039;,
-			&#039;namespace&#039; =&gt; &#039;&#039;,
-			&#039;import&#039; =&gt; &#039;&#039;,
-			&#039;charset&#039; =&gt; &#039;&#039;,
-		);
-
-		while ( count( $css ) ) {
-			$row = trim( array_shift( $css ) );
-
-			if ( $row == &#039;&#039; ) {
-				continue;
-			}
-			// Single block At-Rule set
-			else if ( $row[ 0 ] == &#039;@&#039; &amp;&amp; $css[ 0 ] == &#039;{&#039; &amp;&amp; trim( $css[ 1 ] ) != &#039;&#039; &amp;&amp; $css[ 2 ] == &#039;}&#039; ) {
-				// Stash selector
-				array_push( $setup[&#039;selectors&#039;], $row );
-
-				// Stash details (after the opening brace)
-				array_push( $setup[&#039;details&#039;], $this-&gt;details( trim( $css[ 1 ] ) ) );
-
-				// drop the details from the stack
-				$css = array_slice( $css, 3 );
-			}
-			// Single line At-Rules (import/charset/namespace)
-			else if ( preg_match( $this-&gt;rliner, $row, $match ) ) {
-				$setup[ $match[ 1 ] ] .= $this-&gt;liner( $row ) . $newline;
-			}
-			// Nested At-Rule declaration blocks
-			else if ( $row[ 0 ] == &#039;@&#039; &amp;&amp; $css[ 0 ] == &#039;{&#039; ) {
-				// Stash atrule as selector
-				array_push( $setup[&#039;selectors&#039;], $this-&gt;token . $row );
-
-				// Stash details (after the opening brace)
-				array_push( $setup[&#039;details&#039;], $this-&gt;nested( $css, preg_match( $this-&gt;rmedia, $row ) ) . $newline );
-			}
-			// Unknown single line At-Rules
-			else if ( $row[ 0 ] == &#039;@&#039; &amp;&amp; substr( $row, -1 ) == &#039;;&#039; ) {
-				$setup[ &#039;introliner&#039; ] .= $row . $newline;
-			}
-			// Declaration Block
-			else if ( count( $css ) &gt;= 3 &amp;&amp; $css[ 0 ] == &#039;{&#039; &amp;&amp; $css[ 2 ] == &#039;}&#039; ) {
-				// Stash selector
-				array_push( $setup[&#039;selectors&#039;], $row );
-
-				// Stash details (after the opening brace)
-				array_push( $setup[&#039;details&#039;], $this-&gt;details( trim( $css[ 1 ] ) ) );
-
-				// drop the details from the stack
-				$css = array_slice( $css, 3 );
-			}
-			// Last catch, store unknown artifacts as selectors with a token
-			// and give it an empty rule set
-			else {
-				// Still add to unknown stack, for notification
-				array_push( $setup[&#039;unknown&#039;], $row );
-
-				// Stash unknown artifacts as selectors with a token
-				array_push( $setup[&#039;selectors&#039;], $this-&gt;token . $row );
-
-				// Give it an empty rule set
-				array_push( $setup[&#039;details&#039;], &#039;&#039; );
-			}
-		}
-
-		return $setup;
-	}
-
-	/**
-	 * Run nested elements through a separate instance of compression
-	 *
-	 * @param (array) css: Reference to the original css array
-	 * @param (bool) organize: Whether or not to organize the subsection (only true for media sections)
-	 */
-	private function nested( &amp;$css = array(), $organize = false ) {
-		$options = $this-&gt;options;
-		$left = 0;
-		$right = 0;
-		$row = &#039;&#039;;
-		$independent = &#039;&#039;;
-		$content = &#039;&#039;;
-		$spacing = &#039;&#039;;
-		$newline = $this-&gt;options[&#039;readability&#039;] &gt; CSSCompression::READ_NONE ? &quot;\n&quot; : &#039;&#039;;
-
-		// Find the end of the nested section
-		while ( count( $css ) &amp;&amp; ( $left &lt; 1 || $left &gt; $right ) ) {
-			$row = trim( array_shift( $css ) );
-
-			if ( $row == &#039;&#039; ) {
-				continue;
-			}
-			else if ( $row == &#039;{&#039; ) {
-				$left++;
-			}
-			else if ( $row == &#039;}&#039; ) {
-				$right++;
-			}
-			else if ( count( $css ) &amp;&amp; substr( $row, 0, 1 ) != &#039;@&#039; &amp;&amp; substr( $css[ 0 ], 0, 1 ) == &#039;@&#039; &amp;&amp; substr( $row, -1 ) == &#039;;&#039; ) {
-				$independent .= $row;
-				continue;
-			}
-
-			$content .= $row;
-		}
-
-		// Ensure copy of instance exists
-		if ( ! $this-&gt;instance ) {
-			$this-&gt;instance = new CSSCompression();
-		}
-
-		// Fresh start
-		$this-&gt;instance-&gt;reset();
-
-		// Compress the nested section independently after removing the wrapping braces
-		// Also make sure to only organize media sections
-		if ( $options[&#039;organize&#039;] == true &amp;&amp; $organize == false ) {
-			$options[&#039;organize&#039;] = false;
-		}
-		// Independent sections should be prepended to the next compressed section
-		$content = ( $independent == &#039;&#039; ? &#039;&#039; : $independent . $newline )
+class CSSCompression_Setup {
+  /**
+   * Trim Patterns
+   *
+   * @class Control: Compression Controller
+   * @class Individuals: Individuals Instance
+   * @instance instance: CSSCompression Instance
+   * @param (string) token: Copy of the injection token
+   * @param (array) options: Reference to options
+   * @param (array) stats: Reference to stats
+   * @param (regex) rsemicolon: Checks for semicolon without an escape &#039;\&#039; character before it
+   * @param (regex) rcolon: Checks for colon without an escape &#039;\&#039; character before it
+   * @param (regex) rbang: Checks for &#039;!&#039; without an escape &#039;\&#039; character before it
+   * @param (regex) rspacebank: Checks for an unescaped space before a bang character
+   * @param (regex) rliner: Matching known 1-line intros
+   * @param (regex) rnested: Matching known subsection handlers
+   * @param (regex) rurl: url wrapper matching
+   * @param (regex) rsinglequote: Checks for unescaped escaped single quote (mouthfull)
+   * @param (array) rsetup: Expanding stylesheet for semi-tokenizing
+   */
+  private $Control;
+  private $Individuals;
+  private $instance;
+  private $token = &#039;&#039;;
+  private $options = array();
+  private $stats = array();
+  private $rsemicolon = &quot;/(?&lt;!\\\);/&quot;;
+  private $rcolon = &quot;/(?&lt;!\\\):/&quot;;
+  private $rbang = &quot;/(?&lt;!\\\)\!/&quot;;
+  private $rspacebang = &quot;/(?&lt;!\\\)\s\!/&quot;;
+  private $rliner = &quot;/^@(import|charset|namespace)/i&quot;;
+  private $rmedia = &quot;/^@media/i&quot;;
+  private $rurl = &quot;/url\((.*?)\)/&quot;;
+  private $rsinglequote = &quot;/(?&lt;!\\\)\\\&#039;/&quot;;
+  private $rsetup = array(
+    &#039;patterns&#039; =&gt; array(
+      &quot;/(?&lt;!\\\){/&quot;,
+      &quot;/(?&lt;!\\\)}/&quot;,
+      &quot;/(?&lt;!\\\)@/&quot;,
+      &quot;/(@(charset|import)[^;]*(?&lt;!\\\);)/&quot;,
+    ),
+    &#039;replacements&#039; =&gt; array(
+      &quot;\n{\n&quot;,
+      &quot;\n}\n&quot;,
+      &quot;\n@&quot;,
+      &quot;$1\n&quot;,
+    ),
+  );
+
+  /**
+   * Stash a reference to the controller on each instantiation
+   *
+   * @param (class) control: CSSCompression Controller
+   */
+  public function __construct( CSSCompression_Control $control ) {
+    $this-&gt;Control = $control;
+    $this-&gt;Individuals = $control-&gt;Individuals;
+    $this-&gt;token = CSSCompression::TOKEN;
+    $this-&gt;options = &amp;$control-&gt;Option-&gt;options;
+    $this-&gt;stats = &amp;$control-&gt;stats;
+  }
+
+  /**
+   * Setup selector and details arrays for compression methods
+   *
+   * @param (string) css: Trimed stylesheet
+   */
+  public function setup( $css ) {
+    // Seperate the element from the elements details
+    $css = explode( &quot;\n&quot;, preg_replace( $this-&gt;rsetup[&#039;patterns&#039;], $this-&gt;rsetup[&#039;replacements&#039;], $css ) );
+    $newline = $this-&gt;options[&#039;readability&#039;] &gt; CSSCompression::READ_NONE ? &quot;\n&quot; : &#039;&#039;;
+    $setup = array(
+      &#039;selectors&#039; =&gt; array(),
+      &#039;details&#039; =&gt; array(),
+      &#039;unknown&#039; =&gt; array(),
+      &#039;introliner&#039; =&gt; &#039;&#039;,
+      &#039;namespace&#039; =&gt; &#039;&#039;,
+      &#039;import&#039; =&gt; &#039;&#039;,
+      &#039;charset&#039; =&gt; &#039;&#039;,
+    );
+
+    while ( count( $css ) ) {
+      $row = trim( array_shift( $css ) );
+
+      if ( $row == &#039;&#039; ) {
+        continue;
+      }
+      // Single block At-Rule set
+      else if ( $row[0] == &#039;@&#039; &amp;&amp; $css[0] == &#039;{&#039; &amp;&amp; trim( $css[1] ) != &#039;&#039; &amp;&amp; $css[2] == &#039;}&#039; ) {
+        // Stash selector
+        array_push( $setup[&#039;selectors&#039;], $row );
+
+        // Stash details (after the opening brace)
+        array_push( $setup[&#039;details&#039;], $this-&gt;details( trim( $css[1] ) ) );
+
+        // drop the details from the stack
+        $css = array_slice( $css, 3 );
+      }
+      // Single line At-Rules (import/charset/namespace)
+      else if ( preg_match( $this-&gt;rliner, $row, $match ) ) {
+        $setup[$match[1]] .= $this-&gt;liner( $row ) . $newline;
+      }
+      // Nested At-Rule declaration blocks
+      else if ( $row[0] == &#039;@&#039; &amp;&amp; $css[0] == &#039;{&#039; ) {
+        // Stash atrule as selector
+        array_push( $setup[&#039;selectors&#039;], $this-&gt;token . $row );
+
+        // Stash details (after the opening brace)
+        array_push( $setup[&#039;details&#039;], $this-&gt;nested( $css, preg_match( $this-&gt;rmedia, $row ) ) . $newline );
+      }
+      // Unknown single line At-Rules
+      else if ( $row[0] == &#039;@&#039; &amp;&amp; substr( $row, -1 ) == &#039;;&#039; ) {
+        $setup[&#039;introliner&#039;] .= $row . $newline;
+      }
+      // Declaration Block
+      else if ( count( $css ) &gt;= 3 &amp;&amp; $css[0] == &#039;{&#039; &amp;&amp; $css[2] == &#039;}&#039; ) {
+        // Stash selector
+        array_push( $setup[&#039;selectors&#039;], $row );
+
+        // Stash details (after the opening brace)
+        array_push( $setup[&#039;details&#039;], $this-&gt;details( trim( $css[1] ) ) );
+
+        // drop the details from the stack
+        $css = array_slice( $css, 3 );
+      }
+      // Last catch, store unknown artifacts as selectors with a token
+      // and give it an empty rule set
+      else {
+        // Still add to unknown stack, for notification
+        array_push( $setup[&#039;unknown&#039;], $row );
+
+        // Stash unknown artifacts as selectors with a token
+        array_push( $setup[&#039;selectors&#039;], $this-&gt;token . $row );
+
+        // Give it an empty rule set
+        array_push( $setup[&#039;details&#039;], &#039;&#039; );
+      }
+    }
+
+    return $setup;
+  }
+
+  /**
+   * Run nested elements through a separate instance of compression
+   *
+   * @param (array) css: Reference to the original css array
+   * @param (bool) organize: Whether or not to organize the subsection (only true for media sections)
+   */
+  private function nested( &amp;$css = array(), $organize = false ) {
+    $options = $this-&gt;options;
+    $left = 0;
+    $right = 0;
+    $row = &#039;&#039;;
+    $independent = &#039;&#039;;
+    $content = &#039;&#039;;
+    $spacing = &#039;&#039;;
+    $newline = $this-&gt;options[&#039;readability&#039;] &gt; CSSCompression::READ_NONE ? &quot;\n&quot; : &#039;&#039;;
+
+    // Find the end of the nested section
+    while ( count( $css ) &amp;&amp; ( $left &lt; 1 || $left &gt; $right ) ) {
+      $row = trim( array_shift( $css ) );
+
+      if ( $row == &#039;&#039; ) {
+        continue;
+      }
+      else if ( $row == &#039;{&#039; ) {
+        $left++;
+      }
+      else if ( $row == &#039;}&#039; ) {
+        $right++;
+      }
+      else if ( count( $css ) &amp;&amp; substr( $row, 0, 1 ) != &#039;@&#039; &amp;&amp; substr( $css[0], 0, 1 ) == &#039;@&#039; &amp;&amp; substr( $row, -1 ) == &#039;;&#039; ) {
+        $independent .= $row;
+        continue;
+      }
+
+      $content .= $row;
+    }
+
+    // Ensure copy of instance exists
+    if ( ! $this-&gt;instance ) {
+      $this-&gt;instance = new CSSCompression();
+    }
+
+    // Fresh start
+    $this-&gt;instance-&gt;reset();
+
+    // Compress the nested section independently after removing the wrapping braces
+    // Also make sure to only organize media sections
+    if ( $options[&#039;organize&#039;] == true &amp;&amp; $organize == false ) {
+      $options[&#039;organize&#039;] = false;
+    }
+    // Independent sections should be prepended to the next compressed section
+    $content = ( $independent == &#039;&#039; ? &#039;&#039; : $independent . $newline )
 			. $this-&gt;instance-&gt;compress( substr( $content, 1, -1 ), $options );
 
-		// Formatting for anything higher then 0 readability
-		if ( $newline == &quot;\n&quot; ) {
-			$content = &quot;\n\t&quot; . str_replace( &quot;\n&quot;, &quot;\n\t&quot;, $content ) . &quot;\n&quot;;
-			$spacing = $this-&gt;options[&#039;readability&#039;] &gt; CSSCompression::READ_MIN ? &#039; &#039; : &#039;&#039;;
-		}
-
-		// Stash the compressed nested script
-		return &quot;$spacing{&quot; . $content . &quot;}$newline&quot;;
-	}
-
-	/**
-	 * Converts import/namespace urls into strings
-	 *
-	 * @param (string) row: At-rule
-	 */
-	private function liner( $row ) {
-		$pos = 0;
-		while ( preg_match( $this-&gt;rurl, $row, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			$quote = preg_match( $this-&gt;rsinglequote, $match[ 1 ][ 0 ] ) ? &#039;&quot;&#039; : &quot;&#039;&quot;;
-			$replace = $quote . $match[ 1 ][ 0 ] . $quote;
-			$row = substr_replace( $row, $replace, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
-			$pos = $match[ 0 ][ 1 ] + strlen( $replace );
-		}
-
-		return $row;
-	}
-
-	/**
-	 * Run individual compression techniques on each property of a selector
-	 *
-	 * @param (string) row: Selector properties
-	 */
-	private function details( $row ) {
-		$row = preg_split( $this-&gt;rsemicolon, $row );
-		$parts = array();
-		$details = &#039;&#039;;
-
-		foreach ( $row as $line ) {
-			// Set loopers
-			$parts = preg_split( $this-&gt;rcolon, $line, 2 );
-			$prop = &#039;&#039;;
-			$value = &#039;&#039;;
-
-			// Property
-			if ( isset( $parts[ 0 ] ) &amp;&amp; ( $parts[ 0 ] = trim( $parts[ 0 ] ) ) != &#039;&#039; ) {
-				$prop = $parts[ 0 ];
-			}
-
-			// Value
-			if ( isset( $parts[ 1 ] ) &amp;&amp; ( $parts[ 1 ] = trim( $parts[ 1 ] ) ) != &#039;&#039; ) {
-				$value = preg_replace( $this-&gt;rbang, &#039; !&#039;, $parts[ 1 ] );
-			}
-
-			// Fail safe, remove unspecified property/values
-			if ( $prop == &#039;&#039; || $value == &#039;&#039; ) {
-				continue;
-			}
-
-			// Run the tag/element through each compression
-			list ( $prop, $value ) = $this-&gt;Individuals-&gt;individuals( $prop, $value );
-
-			// Add counter to before stats
-			$this-&gt;stats[&#039;before&#039;][&#039;props&#039;]++;
-
-			// Store the compressed element
-			$details .= &quot;$prop:&quot; . preg_replace( $this-&gt;rspacebang, &#039;!&#039;, $value ) . &quot;;&quot;;
-		}
-
-		return $details;
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Setup Class - &quot; . $method );
-		}
-	}
-};
+    // Formatting for anything higher then 0 readability
+    if ( $newline == &quot;\n&quot; ) {
+      $content = &quot;\n\t&quot; . str_replace( &quot;\n&quot;, &quot;\n\t&quot;, $content ) . &quot;\n&quot;;
+      $spacing = $this-&gt;options[&#039;readability&#039;] &gt; CSSCompression::READ_MIN ? &#039; &#039; : &#039;&#039;;
+    }
+
+    // Stash the compressed nested script
+    return &quot;$spacing{&quot; . $content . &quot;}$newline&quot;;
+  }
+
+  /**
+   * Converts import/namespace urls into strings
+   *
+   * @param (string) row: At-rule
+   */
+  private function liner( $row ) {
+    $pos = 0;
+    while ( preg_match( $this-&gt;rurl, $row, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      $quote = preg_match( $this-&gt;rsinglequote, $match[1][0] ) ? &#039;&quot;&#039; : &quot;&#039;&quot;;
+      $replace = $quote . $match[1][0] . $quote;
+      $row = substr_replace( $row, $replace, $match[0][1], strlen( $match[0][0] ) );
+      $pos = $match[0][1] + strlen( $replace );
+    }
+
+    return $row;
+  }
+
+  /**
+   * Run individual compression techniques on each property of a selector
+   *
+   * @param (string) row: Selector properties
+   */
+  private function details( $row ) {
+    $row = preg_split( $this-&gt;rsemicolon, $row );
+    $parts = array();
+    $details = &#039;&#039;;
+
+    foreach ( $row as $line ) {
+      // Set loopers
+      $parts = preg_split( $this-&gt;rcolon, $line, 2 );
+      $prop = &#039;&#039;;
+      $value = &#039;&#039;;
+
+      // Property
+      if ( isset( $parts[0] ) &amp;&amp; ( $parts[0] = trim( $parts[0] ) ) != &#039;&#039; ) {
+        $prop = $parts[0];
+      }
+
+      // Value
+      if ( isset( $parts[1] ) &amp;&amp; ( $parts[1] = trim( $parts[1] ) ) != &#039;&#039; ) {
+        $value = preg_replace( $this-&gt;rbang, &#039; !&#039;, $parts[1] );
+      }
+
+      // Fail safe, remove unspecified property/values
+      if ( $prop == &#039;&#039; || $value == &#039;&#039; ) {
+        continue;
+      }
+
+      // Run the tag/element through each compression
+      list( $prop, $value ) = $this-&gt;Individuals-&gt;individuals( $prop, $value );
+
+      // Add counter to before stats
+      $this-&gt;stats[&#039;before&#039;][&#039;props&#039;]++;
+
+      // Store the compressed element
+      $details .= &quot;$prop:&quot; . preg_replace( $this-&gt;rspacebang, &#039;!&#039;, $value ) . &quot;;&quot;;
+    }
+
+    return $details;
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Setup Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/css-compressor-3.x/src/lib/Trim.inc advagg_css_compress/css-compressor-3.x/src/lib/Trim.inc
--- advagg_css_compress/css-compressor-3.x/src/lib/Trim.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/css-compressor-3.x/src/lib/Trim.inc	2012-03-23 13:02:20.000000000 -0600
@@ -5,207 +5,206 @@
  * Corey Hart @ http://www.codenothing.com
  */
 
-Class CSSCompression_Trim
-{
-	/**
-	 * Trim Patterns
-	 *
-	 * @class Control: Compression Controller
-	 * @param (array) options: Reference to options
-	 * @param (regex) rcmark: Marking point when traversing through sheet for comments
-	 * @param (regex) rendcomment: Finds the ending comment point
-	 * @param (regex) rendquote: Finds the ending quote point
-	 * @param (regex) rendsinglequote: Finds the ending single quote point
-	 * @param (array) rescape: Array of patterns of groupings that should be escaped
-	 * @param (array) trimmings: Stylesheet trimming patterns/replacements
-	 * @param (array) escaped: Array of characters that need to be escaped
-	 */
-	private $Control;
-	private $options = array();
-	private $rcmark = &quot;/((?&lt;!\\\)\/\*|(?&lt;!\\\)\&quot;|(?&lt;!\\\)&#039;)/&quot;;
-	private $rendcomment = &quot;/\*\//&quot;;
-	private $rendquote = &quot;/(?&lt;!\\\)\&quot;/&quot;;
-	private $rendsinglequote = &quot;/(?&lt;!\\\)&#039;/&quot;;
-	private $rescape = array(
-		&quot;/(url\()([^&#039;\&quot;].*?)(\))/is&quot;,
-		&quot;/((?&lt;!\\\)\&quot;)(.*?)((?&lt;!\\\)\&quot;)/s&quot;,
-		&quot;/((?&lt;!\\\)&#039;)(.*?)((?&lt;!\\\)&#039;)/s&quot;,
-	);
-	private $trimmings = array(
-		&#039;patterns&#039; =&gt; array(
-			&quot;/(?&lt;!\\\)(\s+)?(?&lt;!\\\)([!,{};&gt;\~\+\/])(?&lt;!\\\)(\s+)?/s&quot;, // Remove un-needed spaces around special characters
-			&quot;/url\((?&lt;!\\\)\&quot;(.*?)(?&lt;!\\\)\&quot;\)/is&quot;, // Remove quotes from urls
-			&quot;/url\((?&lt;!\\\)&#039;(.*?)(?&lt;!\\\)&#039;\)/is&quot;, // Remove single quotes from urls
-			&quot;/url\((.*?)\)/is&quot;, // Lowercase url wrapper
-			&quot;/(?&lt;!\\\);{2,}/&quot;, // Remove unecessary semi-colons
-			&quot;/(?&lt;!\\\)\s+/s&quot;, // Compress all spaces into single space
-		),
-		&#039;replacements&#039; =&gt; array(
-			&#039;$2&#039;,
-			&#039;url($1)&#039;,
-			&#039;url($1)&#039;,
-			&#039;url($1)&#039;,
-			&#039;;&#039;,
-			&#039; &#039;,
-		)
-	);
-	private $escaped = array(
-		&#039;search&#039; =&gt; array(
-			&quot;:&quot;,
-			&quot;;&quot;,
-			&quot;}&quot;,
-			&quot;{&quot;,
-			&quot;@&quot;,
-			&quot;!&quot;,
-			&quot;,&quot;,
-			&quot;&gt;&quot;,
-			&quot;+&quot;,
-			&quot;~&quot;,
-			&quot;/&quot;,
-			&quot;*&quot;,
-			&quot;.&quot;,
-			&quot;=&quot;,
-			&quot;#&quot;,
-			&quot;\r&quot;,
-			&quot;\n&quot;,
-			&quot;\t&quot;,
-			&quot; &quot;,
-		),
-		&#039;replace&#039; =&gt; array(
-			&quot;\\:&quot;,
-			&quot;\\;&quot;,
-			&quot;\\}&quot;,
-			&quot;\\{&quot;,
-			&quot;\\@&quot;,
-			&quot;\\!&quot;,
-			&quot;\\,&quot;,
-			&quot;\\&gt;&quot;,
-			&quot;\\+&quot;,
-			&quot;\\~&quot;,
-			&quot;\\/&quot;,
-			&quot;\\*&quot;,
-			&quot;\\.&quot;,
-			&quot;\\=&quot;,
-			&quot;\\#&quot;,
-			&quot;\\r&quot;,
-			&quot;\\n&quot;,
-			&quot;\\t&quot;,
-			&quot;\\ &quot;,
-		),
-	);
-
-	/**
-	 * Stash a reference to the controller on each instantiation
-	 *
-	 * @param (class) control: CSSCompression Controller
-	 */
-	public function __construct( CSSCompression_Control $control ) {
-		$this-&gt;Control = $control;
-		$this-&gt;options = &amp;$control-&gt;Option-&gt;options;
-	}
-
-	/**
-	 * Central trim handler
-	 *
-	 * @param (string) css: Stylesheet to trim
-	 */
-	public function trim( $css ) {
-		$css = $this-&gt;comments( $css );
-		$css = $this-&gt;escape( $css );
-		$css = $this-&gt;strip( $css );
-		return $css;
-	}
-
-	/**
-	 * Does a quick run through the script to remove all comments from the sheet,
-	 *
-	 * @param (string) css: Stylesheet to trim
-	 */
-	private function comments( $css ) {
-		$pos = 0;
-		while ( preg_match( $this-&gt;rcmark, $css, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
-			switch ( $match[ 1 ][ 0 ] ) {
-				// Start of comment block
-				case &quot;/*&quot;:
-					if ( preg_match( $this-&gt;rendcomment, $css, $m, PREG_OFFSET_CAPTURE, $match[ 1 ][ 1 ] + 1 ) ) {
-						$end = $m[ 0 ][ 1 ] - $match[ 1 ][ 1 ] + strlen( $m[ 0 ][ 0 ] );
-						$css = substr_replace( $css, &#039;&#039;, $match[ 1 ][ 1 ], $end );
-						$pos = $match[ 0 ][ 1 ];
-					}
-					else {
-						$css = substr( $css, 0, $match[ 1 ][ 1 ] );
-						break 2;
-					}
-					break;
-				// Start of string
-				case &quot;\&quot;&quot;:
-					if ( preg_match( $this-&gt;rendquote, $css, $m, PREG_OFFSET_CAPTURE, $match[ 1 ][ 1 ] + 1 ) ) {
-						$pos = $m[ 0 ][ 1 ] + strlen( $m[ 0 ][ 0 ] );
-					}
-					else {
-						break 2;
-					}
-					break;
-				// Start of string
-				case &quot;&#039;&quot;:
-					if ( preg_match( $this-&gt;rendsinglequote, $css, $m, PREG_OFFSET_CAPTURE, $match[ 1 ][ 1 ] + 1 ) ) {
-						$pos = $m[ 0 ][ 1 ] + strlen( $m[ 0 ][ 0 ] );
-					}
-					else {
-						break 2;
-					}
-					break;
-				// Should have never gotten here
-				default:
-					break 2;
-			}
-		}
-
-		return $css;
-	}
-
-	/**
-	 * Escape out possible splitter characters within urls
-	 *
-	 * @param (string) css: Full stylesheet
-	 */
-	private function escape( $css ) {
-		foreach ( $this-&gt;rescape as $regex ) {
-			$start = 0;
-			while ( preg_match( $regex, $css, $match, PREG_OFFSET_CAPTURE, $start ) ) {
-				$value = $match[ 1 ][ 0 ]
-					. str_replace( $this-&gt;escaped[&#039;search&#039;], $this-&gt;escaped[&#039;replace&#039;], $match[ 2 ][ 0 ] )
-					. $match[ 3 ][ 0 ];
-				$css = substr_replace( $css, $value, $match[ 0 ][ 1 ], strlen( $match[ 0 ][ 0 ] ) );
-				$start = $match[ 0 ][ 1 ] + strlen( $value ) + 1;
-			}
-		}
-
-		return $css;
-	}
-
-	/**
-	 * Runs initial formatting to setup for compression
-	 *
-	 * @param (string) css: CSS Contents
-	 */
-	private function strip( $css ) {
-		// Run replacements
-		return trim( preg_replace( $this-&gt;trimmings[&#039;patterns&#039;], $this-&gt;trimmings[&#039;replacements&#039;], $css ) );
-	}
-
-	/**
-	 * Access to private methods for testing
-	 *
-	 * @param (string) method: Method to be called
-	 * @param (array) args: Array of paramters to be passed in
-	 */
-	public function access( $method, $args ) {
-		if ( method_exists( $this, $method ) ) {
-			return call_user_func_array( array( $this, $method ), $args );
-		}
-		else {
-			throw new CSSCompression_Exception( &quot;Unknown method in Trim Class - &quot; . $method );
-		}
-	}
-};
+class CSSCompression_Trim {
+  /**
+   * Trim Patterns
+   *
+   * @class Control: Compression Controller
+   * @param (array) options: Reference to options
+   * @param (regex) rcmark: Marking point when traversing through sheet for comments
+   * @param (regex) rendcomment: Finds the ending comment point
+   * @param (regex) rendquote: Finds the ending quote point
+   * @param (regex) rendsinglequote: Finds the ending single quote point
+   * @param (array) rescape: Array of patterns of groupings that should be escaped
+   * @param (array) trimmings: Stylesheet trimming patterns/replacements
+   * @param (array) escaped: Array of characters that need to be escaped
+   */
+  private $Control;
+  private $options = array();
+  private $rcmark = &quot;/((?&lt;!\\\)\/\*|(?&lt;!\\\)\&quot;|(?&lt;!\\\)&#039;)/&quot;;
+  private $rendcomment = &quot;/\*\//&quot;;
+  private $rendquote = &quot;/(?&lt;!\\\)\&quot;/&quot;;
+  private $rendsinglequote = &quot;/(?&lt;!\\\)&#039;/&quot;;
+  private $rescape = array(
+    &quot;/(url\()([^&#039;\&quot;].*?)(\))/is&quot;,
+    &quot;/((?&lt;!\\\)\&quot;)(.*?)((?&lt;!\\\)\&quot;)/s&quot;,
+    &quot;/((?&lt;!\\\)&#039;)(.*?)((?&lt;!\\\)&#039;)/s&quot;,
+  );
+  private $trimmings = array(
+    &#039;patterns&#039; =&gt; array(
+      &quot;/(?&lt;!\\\)(\s+)?(?&lt;!\\\)([!,{};&gt;\~\+\/])(?&lt;!\\\)(\s+)?/s&quot;, // Remove un-needed spaces around special characters
+      &quot;/url\((?&lt;!\\\)\&quot;(.*?)(?&lt;!\\\)\&quot;\)/is&quot;, // Remove quotes from urls
+      &quot;/url\((?&lt;!\\\)&#039;(.*?)(?&lt;!\\\)&#039;\)/is&quot;, // Remove single quotes from urls
+      &quot;/url\((.*?)\)/is&quot;, // Lowercase url wrapper
+      &quot;/(?&lt;!\\\);{2,}/&quot;, // Remove unecessary semi-colons
+      &quot;/(?&lt;!\\\)\s+/s&quot;, // Compress all spaces into single space
+    ),
+    &#039;replacements&#039; =&gt; array(
+      &#039;$2&#039;,
+      &#039;url($1)&#039;,
+      &#039;url($1)&#039;,
+      &#039;url($1)&#039;,
+      &#039;;&#039;,
+      &#039; &#039;,
+    ),
+  );
+  private $escaped = array(
+    &#039;search&#039; =&gt; array(
+      &quot;:&quot;,
+      &quot;;&quot;,
+      &quot;}&quot;,
+      &quot;{&quot;,
+      &quot;@&quot;,
+      &quot;!&quot;,
+      &quot;,&quot;,
+      &quot;&gt;&quot;,
+      &quot;+&quot;,
+      &quot;~&quot;,
+      &quot;/&quot;,
+      &quot;*&quot;,
+      &quot;.&quot;,
+      &quot;=&quot;,
+      &quot;#&quot;,
+      &quot;\r&quot;,
+      &quot;\n&quot;,
+      &quot;\t&quot;,
+      &quot; &quot;,
+    ),
+    &#039;replace&#039; =&gt; array(
+      &quot;\\:&quot;,
+      &quot;\\;&quot;,
+      &quot;\\}&quot;,
+      &quot;\\{&quot;,
+      &quot;\\@&quot;,
+      &quot;\\!&quot;,
+      &quot;\\,&quot;,
+      &quot;\\&gt;&quot;,
+      &quot;\\+&quot;,
+      &quot;\\~&quot;,
+      &quot;\\/&quot;,
+      &quot;\\*&quot;,
+      &quot;\\.&quot;,
+      &quot;\\=&quot;,
+      &quot;\\#&quot;,
+      &quot;\\r&quot;,
+      &quot;\\n&quot;,
+      &quot;\\t&quot;,
+      &quot;\\ &quot;,
+    ),
+  );
+
+  /**
+   * Stash a reference to the controller on each instantiation
+   *
+   * @param (class) control: CSSCompression Controller
+   */
+  public function __construct( CSSCompression_Control $control ) {
+    $this-&gt;Control = $control;
+    $this-&gt;options = &amp;$control-&gt;Option-&gt;options;
+  }
+
+  /**
+   * Central trim handler
+   *
+   * @param (string) css: Stylesheet to trim
+   */
+  public function trim( $css ) {
+    $css = $this-&gt;comments( $css );
+    $css = $this-&gt;escape( $css );
+    $css = $this-&gt;strip( $css );
+    return $css;
+  }
+
+  /**
+   * Does a quick run through the script to remove all comments from the sheet,
+   *
+   * @param (string) css: Stylesheet to trim
+   */
+  private function comments( $css ) {
+    $pos = 0;
+    while ( preg_match( $this-&gt;rcmark, $css, $match, PREG_OFFSET_CAPTURE, $pos ) ) {
+      switch ( $match[1][0] ) {
+        // Start of comment block
+        case &quot;/*&quot;:
+          if ( preg_match( $this-&gt;rendcomment, $css, $m, PREG_OFFSET_CAPTURE, $match[1][1] + 1 ) ) {
+            $end = $m[0][1] - $match[1][1] + strlen( $m[0][0] );
+            $css = substr_replace( $css, &#039;&#039;, $match[1][1], $end );
+            $pos = $match[0][1];
+          }
+          else {
+            $css = substr( $css, 0, $match[1][1] );
+            break 2;
+          }
+          break;
+          // Start of string
+        case &quot;\&quot;&quot;:
+          if ( preg_match( $this-&gt;rendquote, $css, $m, PREG_OFFSET_CAPTURE, $match[1][1] + 1 ) ) {
+            $pos = $m[0][1] + strlen( $m[0][0] );
+          }
+          else {
+            break 2;
+          }
+          break;
+          // Start of string
+        case &quot;&#039;&quot;:
+          if ( preg_match( $this-&gt;rendsinglequote, $css, $m, PREG_OFFSET_CAPTURE, $match[1][1] + 1 ) ) {
+            $pos = $m[0][1] + strlen( $m[0][0] );
+          }
+          else {
+            break 2;
+          }
+          break;
+          // Should have never gotten here
+        default:
+          break 2;
+      }
+    }
+
+    return $css;
+  }
+
+  /**
+   * Escape out possible splitter characters within urls
+   *
+   * @param (string) css: Full stylesheet
+   */
+  private function escape( $css ) {
+    foreach ( $this-&gt;rescape as $regex ) {
+      $start = 0;
+      while ( preg_match( $regex, $css, $match, PREG_OFFSET_CAPTURE, $start ) ) {
+        $value = $match[1][0]
+					. str_replace( $this-&gt;escaped[&#039;search&#039;], $this-&gt;escaped[&#039;replace&#039;], $match[2][0] )
+					. $match[3][0];
+        $css = substr_replace( $css, $value, $match[0][1], strlen( $match[0][0] ) );
+        $start = $match[0][1] + strlen( $value ) + 1;
+      }
+    }
+
+    return $css;
+  }
+
+  /**
+   * Runs initial formatting to setup for compression
+   *
+   * @param (string) css: CSS Contents
+   */
+  private function strip( $css ) {
+    // Run replacements
+    return trim( preg_replace( $this-&gt;trimmings[&#039;patterns&#039;], $this-&gt;trimmings[&#039;replacements&#039;], $css ) );
+  }
+
+  /**
+   * Access to private methods for testing
+   *
+   * @param (string) method: Method to be called
+   * @param (array) args: Array of paramters to be passed in
+   */
+  public function access( $method, $args ) {
+    if ( method_exists( $this, $method ) ) {
+      return call_user_func_array( array($this, $method), $args );
+    }
+    else {
+      throw new CSSCompression_Exception( &quot;Unknown method in Trim Class - &quot; . $method );
+    }
+  }
+}
diff -up -r advagg_css_compress/csstidy/class.csstidy.inc advagg_css_compress/csstidy/class.csstidy.inc
--- advagg_css_compress/csstidy/class.csstidy.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/csstidy/class.csstidy.inc	2012-03-23 13:02:20.000000000 -0600
@@ -72,1056 +72,1108 @@ require(&#039;class.csstidy_optimise.inc&#039;);
  */
 class csstidy {
 
-	/**
-	 * Saves the parsed CSS. This array is empty if preserve_css is on.
-	 * @var array
-	 * @access public
-	 */
-	var $css = array();
-	/**
-	 * Saves the parsed CSS (raw)
-	 * @var array
-	 * @access private
-	 */
-	var $tokens = array();
-	/**
-	 * Printer class
-	 * @see csstidy_print
-	 * @var object
-	 * @access public
-	 */
-	var $print;
-	/**
-	 * Optimiser class
-	 * @see csstidy_optimise
-	 * @var object
-	 * @access private
-	 */
-	var $optimise;
-	/**
-	 * Saves the CSS charset (@charset)
-	 * @var string
-	 * @access private
-	 */
-	var $charset = &#039;&#039;;
-	/**
-	 * Saves all @import URLs
-	 * @var array
-	 * @access private
-	 */
-	var $import = array();
-	/**
-	 * Saves the namespace
-	 * @var string
-	 * @access private
-	 */
-	var $namespace = &#039;&#039;;
-	/**
-	 * Contains the version of csstidy
-	 * @var string
-	 * @access private
-	 */
-	var $version = &#039;1.3&#039;;
-	/**
-	 * Stores the settings
-	 * @var array
-	 * @access private
-	 */
-	var $settings = array();
-	/**
-	 * Saves the parser-status.
-	 *
-	 * Possible values:
-	 * - is = in selector
-	 * - ip = in property
-	 * - iv = in value
-	 * - instr = in string (started at &quot; or &#039; or ( )
-	 * - ic = in comment (ignore everything)
-	 * - at = in @-block
-	 *
-	 * @var string
-	 * @access private
-	 */
-	var $status = &#039;is&#039;;
-	/**
-	 * Saves the current at rule (@media)
-	 * @var string
-	 * @access private
-	 */
-	var $at = &#039;&#039;;
-	/**
-	 * Saves the current selector
-	 * @var string
-	 * @access private
-	 */
-	var $selector = &#039;&#039;;
-	/**
-	 * Saves the current property
-	 * @var string
-	 * @access private
-	 */
-	var $property = &#039;&#039;;
-	/**
-	 * Saves the position of , in selectors
-	 * @var array
-	 * @access private
-	 */
-	var $sel_separate = array();
-	/**
-	 * Saves the current value
-	 * @var string
-	 * @access private
-	 */
-	var $value = &#039;&#039;;
-	/**
-	 * Saves the current sub-value
-	 *
-	 * Example for a subvalue:
-	 * background:url(foo.png) red no-repeat;
-	 * &quot;url(foo.png)&quot;, &quot;red&quot;, and  &quot;no-repeat&quot; are subvalues,
-	 * seperated by whitespace
-	 * @var string
-	 * @access private
-	 */
-	var $sub_value = &#039;&#039;;
-	/**
-	 * Array which saves all subvalues for a property.
-	 * @var array
-	 * @see sub_value
-	 * @access private
-	 */
-	var $sub_value_arr = array();
-	/**
-	 * Saves the char which opened the last string
-	 * @var string
-	 * @access private
-	 */
-	var $str_char = &#039;&#039;;
-	var $cur_string = &#039;&#039;;
-	/**
-	 * Status from which the parser switched to ic or instr
-	 * @var string
-	 * @access private
-	 */
-	var $from = &#039;&#039;;
-	/**
-	 * Variable needed to manage string-in-strings, for example url(&quot;foo.png&quot;)
-	 * @var string
-	 * @access private
-	 */
-	var $str_in_str = false;
-	/**
-	 * =true if in invalid at-rule
-	 * @var bool
-	 * @access private
-	 */
-	var $invalid_at = false;
-	/**
-	 * =true if something has been added to the current selector
-	 * @var bool
-	 * @access private
-	 */
-	var $added = false;
-	/**
-	 * Array which saves the message log
-	 * @var array
-	 * @access private
-	 */
-	var $log = array();
-	/**
-	 * Saves the line number
-	 * @var integer
-	 * @access private
-	 */
-	var $line = 1;
-	/**
-	 * Marks if we need to leave quotes for a string
-	 * @var string
-	 * @access private
-	 */
-	var $quoted_string = false;
-
-	/**
-	 * List of tokens
-	 * @var string
-	 */
-	var $tokens_list = &quot;&quot;;
-	/**
-	 * Loads standard template and sets default settings
-	 * @access private
-	 * @version 1.3
-	 */
-	function csstidy() {
-		$this-&gt;settings[&#039;remove_bslash&#039;] = true;
-		$this-&gt;settings[&#039;compress_colors&#039;] = true;
-		$this-&gt;settings[&#039;compress_font-weight&#039;] = true;
-		$this-&gt;settings[&#039;lowercase_s&#039;] = false;
-		/*
-		  1 common shorthands optimization
-		  2 + font property optimization
-		  3 + background property optimization
-		 */
-		$this-&gt;settings[&#039;optimise_shorthands&#039;] = 1;
-		$this-&gt;settings[&#039;remove_last_;&#039;] = true;
-		/* rewrite all properties with low case, better for later gzip OK, safe*/
-		$this-&gt;settings[&#039;case_properties&#039;] = 1;
-		/* sort properties in alpabetic order, better for later gzip
-		 * but can cause trouble in case of overiding same propertie or using hack
-		 */
-		$this-&gt;settings[&#039;sort_properties&#039;] = false;
-		/*
-		  1, 3, 5, etc -- enable sorting selectors inside @media: a{}b{}c{}
-		  2, 5, 8, etc -- enable sorting selectors inside one CSS declaration: a,b,c{}
-		  preserve order by default cause it can break functionnality
-		 */
-		$this-&gt;settings[&#039;sort_selectors&#039;] = 0;
-		/* is dangeroues to be used: CSS is broken sometimes */
-		$this-&gt;settings[&#039;merge_selectors&#039;] = 0;
-		/* preserve or not browser hacks */
-		$this-&gt;settings[&#039;discard_invalid_selectors&#039;] = false;
-		$this-&gt;settings[&#039;discard_invalid_properties&#039;] = false;
-		$this-&gt;settings[&#039;css_level&#039;] = &#039;CSS2.1&#039;;
-		$this-&gt;settings[&#039;preserve_css&#039;] = false;
-		$this-&gt;settings[&#039;timestamp&#039;] = false;
-		$this-&gt;settings[&#039;template&#039;] = &#039;&#039;; // say that propertie exist
-		$this-&gt;set_cfg(&#039;template&#039;,&#039;default&#039;); // call load_template
-		$this-&gt;optimise = new csstidy_optimise($this);
-
-		$this-&gt;tokens_list = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;tokens&#039;];
-	}
-
-	/**
-	 * Get the value of a setting.
-	 * @param string $setting
-	 * @access public
-	 * @return mixed
-	 * @version 1.0
-	 */
-	function get_cfg($setting) {
-		if (isset($this-&gt;settings[$setting])) {
-			return $this-&gt;settings[$setting];
-		}
-		return false;
-	}
-
-	/**
-	 * Load a template
-	 * @param string $template used by set_cfg to load a template via a configuration setting
-	 * @access private
-	 * @version 1.4
-	 */
-	function _load_template($template) {
-		switch ($template) {
-			case &#039;default&#039;:
-				$this-&gt;load_template(&#039;default&#039;);
-				break;
-
-			case &#039;highest&#039;:
-				$this-&gt;load_template(&#039;highest_compression&#039;);
-				break;
-
-			case &#039;high&#039;:
-				$this-&gt;load_template(&#039;high_compression&#039;);
-				break;
-
-			case &#039;low&#039;:
-				$this-&gt;load_template(&#039;low_compression&#039;);
-				break;
-
-			default:
-				$this-&gt;load_template($template);
-				break;
-		}
-	}
-
-	/**
-	 * Set the value of a setting.
-	 * @param string $setting
-	 * @param mixed $value
-	 * @access public
-	 * @return bool
-	 * @version 1.0
-	 */
-	function set_cfg($setting, $value=null) {
-		if (is_array($setting) &amp;&amp; $value === null) {
-			foreach ($setting as $setprop =&gt; $setval) {
-				$this-&gt;settings[$setprop] = $setval;
-			}
-			if (array_key_exists(&#039;template&#039;, $setting)) {
-				$this-&gt;_load_template($this-&gt;settings[&#039;template&#039;]);
-			}
-			return true;
-		} else if (isset($this-&gt;settings[$setting]) &amp;&amp; $value !== &#039;&#039;) {
-			$this-&gt;settings[$setting] = $value;
-			if ($setting === &#039;template&#039;) {
-				$this-&gt;_load_template($this-&gt;settings[&#039;template&#039;]);
-			}
-			return true;
-		}
-		return false;
-	}
-
-	/**
-	 * Adds a token to $this-&gt;tokens
-	 * @param mixed $type
-	 * @param string $data
-	 * @param bool $do add a token even if preserve_css is off
-	 * @access private
-	 * @version 1.0
-	 */
-	function _add_token($type, $data, $do = false) {
-		if ($this-&gt;get_cfg(&#039;preserve_css&#039;) || $do) {
-			$this-&gt;tokens[] = array($type, ($type == COMMENT) ? $data : trim($data));
-		}
-	}
-
-	/**
-	 * Add a message to the message log
-	 * @param string $message
-	 * @param string $type
-	 * @param integer $line
-	 * @access private
-	 * @version 1.0
-	 */
-	function log($message, $type, $line = -1) {
-		if ($line === -1) {
-			$line = $this-&gt;line;
-		}
-		$line = intval($line);
-		$add = array(&#039;m&#039; =&gt; $message, &#039;t&#039; =&gt; $type);
-		if (!isset($this-&gt;log[$line]) || !in_array($add, $this-&gt;log[$line])) {
-			$this-&gt;log[$line][] = $add;
-		}
-	}
-
-	/**
-	 * Parse unicode notations and find a replacement character
-	 * @param string $string
-	 * @param integer $i
-	 * @access private
-	 * @return string
-	 * @version 1.2
-	 */
-	function _unicode(&amp;$string, &amp;$i) {
-		++$i;
-		$add = &#039;&#039;;
-		$replaced = false;
-
-		while ($i &lt; strlen($string) &amp;&amp; (ctype_xdigit($string{$i}) || ctype_space($string{$i})) &amp;&amp; strlen($add) &lt; 6) {
-			$add .= $string{$i};
-
-			if (ctype_space($string{$i})) {
-				break;
-			}
-			$i++;
-		}
-
-		if (hexdec($add) &gt; 47 &amp;&amp; hexdec($add) &lt; 58 || hexdec($add) &gt; 64 &amp;&amp; hexdec($add) &lt; 91 || hexdec($add) &gt; 96 &amp;&amp; hexdec($add) &lt; 123) {
-			$this-&gt;log(&#039;Replaced unicode notation: Changed \\&#039; . $add . &#039; to &#039; . chr(hexdec($add)), &#039;Information&#039;);
-			$add = chr(hexdec($add));
-			$replaced = true;
-		} else {
-			$add = trim(&#039;\\&#039; . $add);
-		}
-
-		if (@ctype_xdigit($string{$i + 1}) &amp;&amp; ctype_space($string{$i})
-						&amp;&amp; !$replaced || !ctype_space($string{$i})) {
-			$i--;
-		}
-
-		if ($add !== &#039;\\&#039; || !$this-&gt;get_cfg(&#039;remove_bslash&#039;) || strpos($this-&gt;tokens_list, $string{$i + 1}) !== false) {
-			return $add;
-		}
-
-		if ($add === &#039;\\&#039;) {
-			$this-&gt;log(&#039;Removed unnecessary backslash&#039;, &#039;Information&#039;);
-		}
-		return &#039;&#039;;
-	}
-
-	/**
-	 * Write formatted output to a file
-	 * @param string $filename
-	 * @param string $doctype when printing formatted, is a shorthand for the document type
-	 * @param bool $externalcss when printing formatted, indicates whether styles to be attached internally or as an external stylesheet
-	 * @param string $title when printing formatted, is the title to be added in the head of the document
-	 * @param string $lang when printing formatted, gives a two-letter language code to be added to the output
-	 * @access public
-	 * @version 1.4
-	 */
-	function write_page($filename, $doctype=&#039;xhtml1.1&#039;, $externalcss=true, $title=&#039;&#039;, $lang=&#039;en&#039;) {
-		$this-&gt;write($filename, true);
-	}
-
-	/**
-	 * Write plain output to a file
-	 * @param string $filename
-	 * @param bool $formatted whether to print formatted or not
-	 * @param string $doctype when printing formatted, is a shorthand for the document type
-	 * @param bool $externalcss when printing formatted, indicates whether styles to be attached internally or as an external stylesheet
-	 * @param string $title when printing formatted, is the title to be added in the head of the document
-	 * @param string $lang when printing formatted, gives a two-letter language code to be added to the output
-	 * @param bool $pre_code whether to add pre and code tags around the code (for light HTML formatted templates)
-	 * @access public
-	 * @version 1.4
-	 */
-	function write($filename, $formatted=false, $doctype=&#039;xhtml1.1&#039;, $externalcss=true, $title=&#039;&#039;, $lang=&#039;en&#039;, $pre_code=true) {
-		$filename .= ( $formatted) ? &#039;.xhtml&#039; : &#039;.css&#039;;
-
-		if (!is_dir(&#039;temp&#039;)) {
-			$madedir = mkdir(&#039;temp&#039;);
-			if (!$madedir) {
-				print &#039;Could not make directory &quot;temp&quot; in &#039; . dirname(__FILE__);
-				exit;
-			}
-		}
-		$handle = fopen(&#039;temp/&#039; . $filename, &#039;w&#039;);
-		if ($handle) {
-			if (!$formatted) {
-				fwrite($handle, $this-&gt;print-&gt;plain());
-			} else {
-				fwrite($handle, $this-&gt;print-&gt;formatted_page($doctype, $externalcss, $title, $lang, $pre_code));
-			}
-		}
-		fclose($handle);
-	}
-
-	/**
-	 * Loads a new template
-	 * @param string $content either filename (if $from_file == true), content of a template file, &quot;high_compression&quot;, &quot;highest_compression&quot;, &quot;low_compression&quot;, or &quot;default&quot;
-	 * @param bool $from_file uses $content as filename if true
-	 * @access public
-	 * @version 1.1
-	 * @see http://csstidy.sourceforge.net/templates.php
-	 */
-	function load_template($content, $from_file=true) {
-		$predefined_templates = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;];
-		if ($content === &#039;high_compression&#039; || $content === &#039;default&#039; || $content === &#039;highest_compression&#039; || $content === &#039;low_compression&#039;) {
-			$this-&gt;template = $predefined_templates[$content];
-			return;
-		}
-
-
-		if ($from_file) {
-			$content = strip_tags(file_get_contents($content), &#039;&lt;span&gt;&#039;);
-		}
-		$content = str_replace(&quot;\r\n&quot;, &quot;\n&quot;, $content); // Unify newlines (because the output also only uses \n)
-		$template = explode(&#039;|&#039;, $content);
-
-		for ($i = 0; $i &lt; count($template); $i++) {
-			$this-&gt;template[$i] = $template[$i];
-		}
-	}
-
-	/**
-	 * Starts parsing from URL
-	 * @param string $url
-	 * @access public
-	 * @version 1.0
-	 */
-	function parse_from_url($url) {
-		return $this-&gt;parse(@file_get_contents($url));
-	}
-
-	/**
-	 * Checks if there is a token at the current position
-	 * @param string $string
-	 * @param integer $i
-	 * @access public
-	 * @version 1.11
-	 */
-	function is_token(&amp;$string, $i) {
-		return (strpos($this-&gt;tokens_list, $string{$i}) !== false &amp;&amp; !csstidy::escaped($string, $i));
-	}
-
-	/**
-	 * Parses CSS in $string. The code is saved as array in $this-&gt;css
-	 * @param string $string the CSS code
-	 * @access public
-	 * @return bool
-	 * @version 1.1
-	 */
-	function parse($string) {
-		// Temporarily set locale to en_US in order to handle floats properly
-		$old = @setlocale(LC_ALL, 0);
-		@setlocale(LC_ALL, &#039;C&#039;);
-
-		// PHP bug? Settings need to be refreshed in PHP4
-		$this-&gt;print = new csstidy_print($this);
-		$this-&gt;optimise = new csstidy_optimise($this);
-
-		$all_properties = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;all_properties&#039;];
-		$at_rules = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;at_rules&#039;];
-
-		$this-&gt;css = array();
-		$this-&gt;print-&gt;input_css = $string;
-		$string = str_replace(&quot;\r\n&quot;, &quot;\n&quot;, $string) . &#039; &#039;;
-		$cur_comment = &#039;&#039;;
-
-		for ($i = 0, $size = strlen($string); $i &lt; $size; $i++) {
-			if ($string{$i} === &quot;\n&quot; || $string{$i} === &quot;\r&quot;) {
-				++$this-&gt;line;
-			}
-
-			switch ($this-&gt;status) {
-				/* Case in at-block */
-				case &#039;at&#039;:
-					if (csstidy::is_token($string, $i)) {
-						if ($string{$i} === &#039;/&#039; &amp;&amp; @$string{$i + 1} === &#039;*&#039;) {
-							$this-&gt;status = &#039;ic&#039;;
-							++$i;
-							$this-&gt;from = &#039;at&#039;;
-						} elseif ($string{$i} === &#039;{&#039;) {
-							$this-&gt;status = &#039;is&#039;;
-							$this-&gt;at = $this-&gt;css_new_media_section($this-&gt;at);
-							$this-&gt;_add_token(AT_START, $this-&gt;at);
-						} elseif ($string{$i} === &#039;,&#039;) {
-							$this-&gt;at = trim($this-&gt;at) . &#039;,&#039;;
-						} elseif ($string{$i} === &#039;\\&#039;) {
-							$this-&gt;at .= $this-&gt;_unicode($string, $i);
-						}
-						// fix for complicated media, i.e @media screen and (-webkit-min-device-pixel-ratio:0)
-						elseif (in_array($string{$i}, array(&#039;(&#039;, &#039;)&#039;, &#039;:&#039;))) {
-							$this-&gt;at .= $string{$i};
-						}
-					} else {
-						$lastpos = strlen($this-&gt;at) - 1;
-						if (!( (ctype_space($this-&gt;at{$lastpos}) || csstidy::is_token($this-&gt;at, $lastpos) &amp;&amp; $this-&gt;at{$lastpos} === &#039;,&#039;) &amp;&amp; ctype_space($string{$i}))) {
-							$this-&gt;at .= $string{$i};
-						}
-					}
-					break;
-
-				/* Case in-selector */
-				case &#039;is&#039;:
-					if (csstidy::is_token($string, $i)) {
-						if ($string{$i} === &#039;/&#039; &amp;&amp; @$string{$i + 1} === &#039;*&#039; &amp;&amp; trim($this-&gt;selector) == &#039;&#039;) {
-							$this-&gt;status = &#039;ic&#039;;
-							++$i;
-							$this-&gt;from = &#039;is&#039;;
-						} elseif ($string{$i} === &#039;@&#039; &amp;&amp; trim($this-&gt;selector) == &#039;&#039;) {
-							// Check for at-rule
-							$this-&gt;invalid_at = true;
-							foreach ($at_rules as $name =&gt; $type) {
-								if (!strcasecmp(substr($string, $i + 1, strlen($name)), $name)) {
-									($type === &#039;at&#039;) ? $this-&gt;at = &#039;@&#039; . $name : $this-&gt;selector = &#039;@&#039; . $name;
-									$this-&gt;status = $type;
-									$i += strlen($name);
-									$this-&gt;invalid_at = false;
-								}
-							}
-
-							if ($this-&gt;invalid_at) {
-								$this-&gt;selector = &#039;@&#039;;
-								$invalid_at_name = &#039;&#039;;
-								for ($j = $i + 1; $j &lt; $size; ++$j) {
-									if (!ctype_alpha($string{$j})) {
-										break;
-									}
-									$invalid_at_name .= $string{$j};
-								}
-								$this-&gt;log(&#039;Invalid @-rule: &#039; . $invalid_at_name . &#039; (removed)&#039;, &#039;Warning&#039;);
-							}
-						} elseif (($string{$i} === &#039;&quot;&#039; || $string{$i} === &quot;&#039;&quot;)) {
-							$this-&gt;cur_string = $string{$i};
-							$this-&gt;status = &#039;instr&#039;;
-							$this-&gt;str_char = $string{$i};
-							$this-&gt;from = &#039;is&#039;;
-							/* fixing CSS3 attribute selectors, i.e. a[href$=&quot;.mp3&quot; */
-							$this-&gt;quoted_string = ($string{$i - 1} == &#039;=&#039; );
-						} elseif ($this-&gt;invalid_at &amp;&amp; $string{$i} === &#039;;&#039;) {
-							$this-&gt;invalid_at = false;
-							$this-&gt;status = &#039;is&#039;;
-						} elseif ($string{$i} === &#039;{&#039;) {
-							$this-&gt;status = &#039;ip&#039;;
-							if($this-&gt;at == &#039;&#039;) {
-								$this-&gt;at = $this-&gt;css_new_media_section(DEFAULT_AT);
-							}
-							$this-&gt;selector = $this-&gt;css_new_selector($this-&gt;at,$this-&gt;selector);
-							$this-&gt;_add_token(SEL_START, $this-&gt;selector);
-							$this-&gt;added = false;
-						} elseif ($string{$i} === &#039;}&#039;) {
-							$this-&gt;_add_token(AT_END, $this-&gt;at);
-							$this-&gt;at = &#039;&#039;;
-							$this-&gt;selector = &#039;&#039;;
-							$this-&gt;sel_separate = array();
-						} elseif ($string{$i} === &#039;,&#039;) {
-							$this-&gt;selector = trim($this-&gt;selector) . &#039;,&#039;;
-							$this-&gt;sel_separate[] = strlen($this-&gt;selector);
-						} elseif ($string{$i} === &#039;\\&#039;) {
-							$this-&gt;selector .= $this-&gt;_unicode($string, $i);
-						} elseif ($string{$i} === &#039;*&#039; &amp;&amp; @in_array($string{$i + 1}, array(&#039;.&#039;, &#039;#&#039;, &#039;[&#039;, &#039;:&#039;))) {
-							// remove unnecessary universal selector, FS#147
-						} else {
-							$this-&gt;selector .= $string{$i};
-						}
-					} else {
-						$lastpos = strlen($this-&gt;selector) - 1;
-						if ($lastpos == -1 || !( (ctype_space($this-&gt;selector{$lastpos}) || csstidy::is_token($this-&gt;selector, $lastpos) &amp;&amp; $this-&gt;selector{$lastpos} === &#039;,&#039;) &amp;&amp; ctype_space($string{$i}))) {
-							$this-&gt;selector .= $string{$i};
-						}
-					}
-					break;
-
-				/* Case in-property */
-				case &#039;ip&#039;:
-					if (csstidy::is_token($string, $i)) {
-						if (($string{$i} === &#039;:&#039; || $string{$i} === &#039;=&#039;) &amp;&amp; $this-&gt;property != &#039;&#039;) {
-							$this-&gt;status = &#039;iv&#039;;
-							if (!$this-&gt;get_cfg(&#039;discard_invalid_properties&#039;) || csstidy::property_is_valid($this-&gt;property)) {
-								$this-&gt;property = $this-&gt;css_new_property($this-&gt;at,$this-&gt;selector,$this-&gt;property);
-								$this-&gt;_add_token(PROPERTY, $this-&gt;property);
-							}
-						} elseif ($string{$i} === &#039;/&#039; &amp;&amp; @$string{$i + 1} === &#039;*&#039; &amp;&amp; $this-&gt;property == &#039;&#039;) {
-							$this-&gt;status = &#039;ic&#039;;
-							++$i;
-							$this-&gt;from = &#039;ip&#039;;
-						} elseif ($string{$i} === &#039;}&#039;) {
-							$this-&gt;explode_selectors();
-							$this-&gt;status = &#039;is&#039;;
-							$this-&gt;invalid_at = false;
-							$this-&gt;_add_token(SEL_END, $this-&gt;selector);
-							$this-&gt;selector = &#039;&#039;;
-							$this-&gt;property = &#039;&#039;;
-						} elseif ($string{$i} === &#039;;&#039;) {
-							$this-&gt;property = &#039;&#039;;
-						} elseif ($string{$i} === &#039;\\&#039;) {
-							$this-&gt;property .= $this-&gt;_unicode($string, $i);
-						}
-						// else this is dumb IE a hack, keep it
-						elseif ($this-&gt;property==&#039;&#039; AND !ctype_space($string{$i})) {
-							$this-&gt;property .= $string{$i};
-						}
-					}
-					elseif (!ctype_space($string{$i})) {
-						$this-&gt;property .= $string{$i};
-					}
-					break;
-
-				/* Case in-value */
-				case &#039;iv&#039;:
-					$pn = (($string{$i} === &quot;\n&quot; || $string{$i} === &quot;\r&quot;) &amp;&amp; $this-&gt;property_is_next($string, $i + 1) || $i == strlen($string) - 1);
-					if (csstidy::is_token($string, $i) || $pn) {
-						if ($string{$i} === &#039;/&#039; &amp;&amp; @$string{$i + 1} === &#039;*&#039;) {
-							$this-&gt;status = &#039;ic&#039;;
-							++$i;
-							$this-&gt;from = &#039;iv&#039;;
-						} elseif (($string{$i} === &#039;&quot;&#039; || $string{$i} === &quot;&#039;&quot; || $string{$i} === &#039;(&#039;)) {
-							$this-&gt;cur_string = $string{$i};
-							$this-&gt;str_char = ($string{$i} === &#039;(&#039;) ? &#039;)&#039; : $string{$i};
-							$this-&gt;status = &#039;instr&#039;;
-							$this-&gt;from = &#039;iv&#039;;
-						} elseif ($string{$i} === &#039;,&#039;) {
-							$this-&gt;sub_value = trim($this-&gt;sub_value) . &#039;,&#039;;
-						} elseif ($string{$i} === &#039;\\&#039;) {
-							$this-&gt;sub_value .= $this-&gt;_unicode($string, $i);
-						} elseif ($string{$i} === &#039;;&#039; || $pn) {
-							if ($this-&gt;selector{0} === &#039;@&#039; &amp;&amp; isset($at_rules[substr($this-&gt;selector, 1)]) &amp;&amp; $at_rules[substr($this-&gt;selector, 1)] === &#039;iv&#039;) {
-								/* Add quotes to charset, import, namespace */
-								$this-&gt;sub_value_arr[] = &#039;&quot;&#039; . trim($this-&gt;sub_value) . &#039;&quot;&#039;;
-
-								$this-&gt;status = &#039;is&#039;;
-
-								switch ($this-&gt;selector) {
-									case &#039;@charset&#039;: $this-&gt;charset = $this-&gt;sub_value_arr[0];
-										break;
-									case &#039;@namespace&#039;: $this-&gt;namespace = implode(&#039; &#039;, $this-&gt;sub_value_arr);
-										break;
-									case &#039;@import&#039;: $this-&gt;import[] = implode(&#039; &#039;, $this-&gt;sub_value_arr);
-										break;
-								}
-
-								$this-&gt;sub_value_arr = array();
-								$this-&gt;sub_value = &#039;&#039;;
-								$this-&gt;selector = &#039;&#039;;
-								$this-&gt;sel_separate = array();
-							} else {
-								$this-&gt;status = &#039;ip&#039;;
-							}
-						} elseif ($string{$i} !== &#039;}&#039;) {
-							$this-&gt;sub_value .= $string{$i};
-						}
-						if (($string{$i} === &#039;}&#039; || $string{$i} === &#039;;&#039; || $pn) &amp;&amp; !empty($this-&gt;selector)) {
-							if ($this-&gt;at == &#039;&#039;) {
-								$this-&gt;at = $this-&gt;css_new_media_section(DEFAULT_AT);
-							}
-
-							// case settings
-							if ($this-&gt;get_cfg(&#039;lowercase_s&#039;)) {
-								$this-&gt;selector = strtolower($this-&gt;selector);
-							}
-							$this-&gt;property = strtolower($this-&gt;property);
-
-							$this-&gt;optimise-&gt;subvalue();
-							if ($this-&gt;sub_value != &#039;&#039;) {
-								/* original, disabled for fix below
-								if (substr($this-&gt;sub_value, 0, 6) == &#039;format&#039;) {
-									$this-&gt;sub_value = str_replace(array(&#039;format(&#039;, &#039;)&#039;), array(&#039;format(&quot;&#039;, &#039;&quot;)&#039;), $this-&gt;sub_value);
-								}//*/
-								$this-&gt;sub_value_arr[] = $this-&gt;sub_value;
-								// [FIX] @font-face with multiple fonts and CSSTidy
-								// (http://www.pixelastic.com/blog/86:csstidy-and-the-woff-fonts)
-								foreach($this-&gt;sub_value_arr as $sub_value) {
-									if (substr($sub_value, 0, 6) == &#039;format&#039;) {
-										$sub_value = str_replace(array(&#039;format(&#039;, &#039;)&#039;), array(&#039;format(&quot;&#039;, &#039;&quot;)&#039;), $sub_value);
-									}
-								}
-								$this-&gt;sub_value = &#039;&#039;;
-							}
-
-							$this-&gt;value = array_shift($this-&gt;sub_value_arr);
-							while(count($this-&gt;sub_value_arr)){
-								$this-&gt;value .= (substr($this-&gt;value,-1,1)==&#039;,&#039;?&#039;&#039;:&#039; &#039;).array_shift($this-&gt;sub_value_arr);
-							}
-
-							$this-&gt;optimise-&gt;value();
-
-							$valid = csstidy::property_is_valid($this-&gt;property);
-							if ((!$this-&gt;invalid_at || $this-&gt;get_cfg(&#039;preserve_css&#039;)) &amp;&amp; (!$this-&gt;get_cfg(&#039;discard_invalid_properties&#039;) || $valid)) {
-								$this-&gt;css_add_property($this-&gt;at, $this-&gt;selector, $this-&gt;property, $this-&gt;value);
-								$this-&gt;_add_token(VALUE, $this-&gt;value);
-								$this-&gt;optimise-&gt;shorthands();
-							}
-							if (!$valid) {
-								if ($this-&gt;get_cfg(&#039;discard_invalid_properties&#039;)) {
-									$this-&gt;log(&#039;Removed invalid property: &#039; . $this-&gt;property, &#039;Warning&#039;);
-								} else {
-									$this-&gt;log(&#039;Invalid property in &#039; . strtoupper($this-&gt;get_cfg(&#039;css_level&#039;)) . &#039;: &#039; . $this-&gt;property, &#039;Warning&#039;);
-								}
-							}
-
-							$this-&gt;property = &#039;&#039;;
-							$this-&gt;sub_value_arr = array();
-							$this-&gt;value = &#039;&#039;;
-						}
-						if ($string{$i} === &#039;}&#039;) {
-							$this-&gt;explode_selectors();
-							$this-&gt;_add_token(SEL_END, $this-&gt;selector);
-							$this-&gt;status = &#039;is&#039;;
-							$this-&gt;invalid_at = false;
-							$this-&gt;selector = &#039;&#039;;
-						}
-					} elseif (!$pn) {
-						$this-&gt;sub_value .= $string{$i};
-
-						if (ctype_space($string{$i})) {
-							$this-&gt;optimise-&gt;subvalue();
-							if ($this-&gt;sub_value != &#039;&#039;) {
-								$this-&gt;sub_value_arr[] = $this-&gt;sub_value;
-								$this-&gt;sub_value = &#039;&#039;;
-							}
-						}
-					}
-					break;
-
-				/* Case in string */
-				case &#039;instr&#039;:
-					if ($this-&gt;str_char === &#039;)&#039; &amp;&amp; ($string{$i} === &#039;&quot;&#039; || $string{$i} === &#039;\&#039;&#039;) &amp;&amp; !$this-&gt;str_in_str &amp;&amp; !csstidy::escaped($string, $i)) {
-						$this-&gt;str_in_str = true;
-					} elseif ($this-&gt;str_char === &#039;)&#039; &amp;&amp; ($string{$i} === &#039;&quot;&#039; || $string{$i} === &#039;\&#039;&#039;) &amp;&amp; $this-&gt;str_in_str &amp;&amp; !csstidy::escaped($string, $i)) {
-						$this-&gt;str_in_str = false;
-					}
-					$temp_add = $string{$i};					 // ...and no not-escaped backslash at the previous position
-					if (($string{$i} === &quot;\n&quot; || $string{$i} === &quot;\r&quot;) &amp;&amp; !($string{$i - 1} === &#039;\\&#039; &amp;&amp; !csstidy::escaped($string, $i - 1))) {
-						$temp_add = &quot;\\A &quot;;
-						$this-&gt;log(&#039;Fixed incorrect newline in string&#039;, &#039;Warning&#039;);
-					}
-					// this optimisation remove space in css3 properties (see vendor-prefixed/webkit-gradient.csst)
-					#if (!($this-&gt;str_char === &#039;)&#039; &amp;&amp; in_array($string{$i}, $GLOBALS[&#039;csstidy&#039;][&#039;whitespace&#039;]) &amp;&amp; !$this-&gt;str_in_str)) {
-						$this-&gt;cur_string .= $temp_add;
-					#}
-					if ($string{$i} == $this-&gt;str_char &amp;&amp; !csstidy::escaped($string, $i) &amp;&amp; !$this-&gt;str_in_str) {
-						$this-&gt;status = $this-&gt;from;
-						if (!preg_match(&#039;|[&#039; . implode(&#039;&#039;, $GLOBALS[&#039;csstidy&#039;][&#039;whitespace&#039;]) . &#039;]|uis&#039;, $this-&gt;cur_string) &amp;&amp; $this-&gt;property !== &#039;content&#039;) {
-							if (!$this-&gt;quoted_string) {
-								if ($this-&gt;str_char === &#039;&quot;&#039; || $this-&gt;str_char === &#039;\&#039;&#039;) {
-									// Temporarily disable this optimization to avoid problems with @charset rule, quote properties, and some attribute selectors...
-									// Attribute selectors fixed, added quotes to @chartset, no problems with properties detected. Enabled
-									$this-&gt;cur_string = substr($this-&gt;cur_string, 1, -1);
-								} else if (strlen($this-&gt;cur_string) &gt; 3 &amp;&amp; ($this-&gt;cur_string[1] === &#039;&quot;&#039; || $this-&gt;cur_string[1] === &#039;\&#039;&#039;)) /* () */ {
-									$this-&gt;cur_string = $this-&gt;cur_string[0] . substr($this-&gt;cur_string, 2, -2) . substr($this-&gt;cur_string, -1);
-								}
-							} else {
-								$this-&gt;quoted_string = false;
-							}
-						}
-						if ($this-&gt;from === &#039;iv&#039;) {
-							if (!$this-&gt;quoted_string){
-								if (strpos($this-&gt;cur_string,&#039;,&#039;)!==false)
-									// we can on only remove space next to &#039;,&#039;
-									$this-&gt;cur_string = implode(&#039;,&#039;,array_map(&#039;trim&#039;,explode(&#039;,&#039;,$this-&gt;cur_string)));
-								// and multiple spaces (too expensive)
-								if (strpos($this-&gt;cur_string,&#039;  &#039;)!==false)
-									$this-&gt;cur_string = preg_replace(&quot;,\s+,&quot;,&quot; &quot;,$this-&gt;cur_string);
-							}
-							$this-&gt;sub_value .= $this-&gt;cur_string;
-						} elseif ($this-&gt;from === &#039;is&#039;) {
-							$this-&gt;selector .= $this-&gt;cur_string;
-						}
-					}
-					break;
-
-				/* Case in-comment */
-				case &#039;ic&#039;:
-					if ($string{$i} === &#039;*&#039; &amp;&amp; $string{$i + 1} === &#039;/&#039;) {
-						$this-&gt;status = $this-&gt;from;
-						$i++;
-						$this-&gt;_add_token(COMMENT, $cur_comment);
-						$cur_comment = &#039;&#039;;
-					} else {
-						$cur_comment .= $string{$i};
-					}
-					break;
-			}
-		}
-
-		$this-&gt;optimise-&gt;postparse();
-
-		$this-&gt;print-&gt;_reset();
-
-		@setlocale(LC_ALL, $old); // Set locale back to original setting
-
-		return!(empty($this-&gt;css) &amp;&amp; empty($this-&gt;import) &amp;&amp; empty($this-&gt;charset) &amp;&amp; empty($this-&gt;tokens) &amp;&amp; empty($this-&gt;namespace));
-	}
-
-	/**
-	 * Explodes selectors
-	 * @access private
-	 * @version 1.0
-	 */
-	function explode_selectors() {
-		// Explode multiple selectors
-		if ($this-&gt;get_cfg(&#039;merge_selectors&#039;) === 1) {
-			$new_sels = array();
-			$lastpos = 0;
-			$this-&gt;sel_separate[] = strlen($this-&gt;selector);
-			foreach ($this-&gt;sel_separate as $num =&gt; $pos) {
-				if ($num == count($this-&gt;sel_separate) - 1) {
-					$pos += 1;
-				}
-
-				$new_sels[] = substr($this-&gt;selector, $lastpos, $pos - $lastpos - 1);
-				$lastpos = $pos;
-			}
-
-			if (count($new_sels) &gt; 1) {
-				foreach ($new_sels as $selector) {
-					if (isset($this-&gt;css[$this-&gt;at][$this-&gt;selector])) {
-						$this-&gt;merge_css_blocks($this-&gt;at, $selector, $this-&gt;css[$this-&gt;at][$this-&gt;selector]);
-					}
-				}
-				unset($this-&gt;css[$this-&gt;at][$this-&gt;selector]);
-			}
-		}
-		$this-&gt;sel_separate = array();
-	}
-
-	/**
-	 * Checks if a character is escaped (and returns true if it is)
-	 * @param string $string
-	 * @param integer $pos
-	 * @access public
-	 * @return bool
-	 * @version 1.02
-	 */
-	static function escaped(&amp;$string, $pos) {
-		return!(@($string{$pos - 1} !== &#039;\\&#039;) || csstidy::escaped($string, $pos - 1));
-	}
-
-	/**
-	 * Adds a property with value to the existing CSS code
-	 * @param string $media
-	 * @param string $selector
-	 * @param string $property
-	 * @param string $new_val
-	 * @access private
-	 * @version 1.2
-	 */
-	function css_add_property($media, $selector, $property, $new_val) {
-		if ($this-&gt;get_cfg(&#039;preserve_css&#039;) || trim($new_val) == &#039;&#039;) {
-			return;
-		}
-
-		$this-&gt;added = true;
-		if (isset($this-&gt;css[$media][$selector][$property])) {
-			if ((csstidy::is_important($this-&gt;css[$media][$selector][$property]) &amp;&amp; csstidy::is_important($new_val)) || !csstidy::is_important($this-&gt;css[$media][$selector][$property])) {
-				$this-&gt;css[$media][$selector][$property] = trim($new_val);
-			}
-		} else {
-			$this-&gt;css[$media][$selector][$property] = trim($new_val);
-		}
-	}
-
-	/**
-	 * Start a new media section.
-	 * Check if the media is not already known,
-	 * else rename it with extra spaces
-	 * to avoid merging
-	 *
-	 * @param string $media
-	 * @return string
-	 */
-	function css_new_media_section($media){
-		if($this-&gt;get_cfg(&#039;preserve_css&#039;)) {
-			return $media;
-		}
-
-		// if the last @media is the same as this
-		// keep it
-		if (!$this-&gt;css OR !is_array($this-&gt;css) OR empty($this-&gt;css)){
-			return $media;
-		}
-		end($this-&gt;css);
-		list($at,) = each($this-&gt;css);
-		if ($at == $media){
-			return $media;
-		}
-		while (isset($this-&gt;css[$media]))
-			if (is_numeric($media))
-				$media++;
-			else
-				$media .= &quot; &quot;;
-		return $media;
-	}
-
-	/**
-	 * Start a new selector.
-	 * If already referenced in this media section,
-	 * rename it with extra space to avoid merging
-	 * except if merging is required,
-	 * or last selector is the same (merge siblings)
-	 *
-	 * never merge @font-face
-	 *
-	 * @param string $media
-	 * @param string $selector
-	 * @return string
-	 */
-	function css_new_selector($media,$selector){
-		if($this-&gt;get_cfg(&#039;preserve_css&#039;)) {
-			return $selector;
-		}
-		$selector = trim($selector);
-		if (strncmp($selector,&quot;@font-face&quot;,10)!=0){
-			if ($this-&gt;settings[&#039;merge_selectors&#039;] != false)
-				return $selector;
-
-			if (!$this-&gt;css OR !isset($this-&gt;css[$media]) OR !$this-&gt;css[$media])
-				return $selector;
-
-			// if last is the same, keep it
-			end($this-&gt;css[$media]);
-			list($sel,) = each($this-&gt;css[$media]);
-			if ($sel == $selector){
-				return $selector;
-			}
-		}
-
-		while (isset($this-&gt;css[$media][$selector]))
-			$selector .= &quot; &quot;;
-		return $selector;
-	}
-
-	/**
-	 * Start a new propertie.
-	 * If already references in this selector,
-	 * rename it with extra space to avoid override
-	 *
-	 * @param string $media
-	 * @param string $selector
-	 * @param string $property
-	 * @return string
-	 */
-	function css_new_property($media, $selector, $property){
-		if($this-&gt;get_cfg(&#039;preserve_css&#039;)) {
-			return $property;
-		}
-		if (!$this-&gt;css OR !isset($this-&gt;css[$media][$selector]) OR !$this-&gt;css[$media][$selector])
-			return $property;
-
-		while (isset($this-&gt;css[$media][$selector][$property]))
-			$property .= &quot; &quot;;
-
-		return $property;
-	}
-
-	/**
-	 * Adds CSS to an existing media/selector
-	 * @param string $media
-	 * @param string $selector
-	 * @param array $css_add
-	 * @access private
-	 * @version 1.1
-	 */
-	function merge_css_blocks($media, $selector, $css_add) {
-		foreach ($css_add as $property =&gt; $value) {
-			$this-&gt;css_add_property($media, $selector, $property, $value, false);
-		}
-	}
-
-	/**
-	 * Checks if $value is !important.
-	 * @param string $value
-	 * @return bool
-	 * @access public
-	 * @version 1.0
-	 */
-	static function is_important(&amp;$value) {
-		return (!strcasecmp(substr(str_replace($GLOBALS[&#039;csstidy&#039;][&#039;whitespace&#039;], &#039;&#039;, $value), -10, 10), &#039;!important&#039;));
-	}
-
-	/**
-	 * Returns a value without !important
-	 * @param string $value
-	 * @return string
-	 * @access public
-	 * @version 1.0
-	 */
-	static function gvw_important($value) {
-		if (csstidy::is_important($value)) {
-			$value = trim($value);
-			$value = substr($value, 0, -9);
-			$value = trim($value);
-			$value = substr($value, 0, -1);
-			$value = trim($value);
-			return $value;
-		}
-		return $value;
-	}
-
-	/**
-	 * Checks if the next word in a string from pos is a CSS property
-	 * @param string $istring
-	 * @param integer $pos
-	 * @return bool
-	 * @access private
-	 * @version 1.2
-	 */
-	function property_is_next($istring, $pos) {
-		$all_properties = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;all_properties&#039;];
-		$istring = substr($istring, $pos, strlen($istring) - $pos);
-		$pos = strpos($istring, &#039;:&#039;);
-		if ($pos === false) {
-			return false;
-		}
-		$istring = strtolower(trim(substr($istring, 0, $pos)));
-		if (isset($all_properties[$istring])) {
-			$this-&gt;log(&#039;Added semicolon to the end of declaration&#039;, &#039;Warning&#039;);
-			return true;
-		}
-		return false;
-	}
-
-	/**
-	 * Checks if a property is valid
-	 * @param string $property
-	 * @return bool;
-	 * @access public
-	 * @version 1.0
-	 */
-	function property_is_valid($property) {
-		$all_properties = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;all_properties&#039;];
-		return (isset($all_properties[$property]) &amp;&amp; strpos($all_properties[$property], strtoupper($this-&gt;get_cfg(&#039;css_level&#039;))) !== false );
-	}
+  /**
+   * Saves the parsed CSS. This array is empty if preserve_css is on.
+   * @var array
+   * @access public
+   */
+  var $css = array();
+  /**
+   * Saves the parsed CSS (raw)
+   * @var array
+   * @access private
+   */
+  var $tokens = array();
+  /**
+   * Printer class
+   * @see csstidy_print
+   * @var object
+   * @access public
+   */
+  var $print;
+  /**
+   * Optimiser class
+   * @see csstidy_optimise
+   * @var object
+   * @access private
+   */
+  var $optimise;
+  /**
+   * Saves the CSS charset (@charset)
+   * @var string
+   * @access private
+   */
+  var $charset = &#039;&#039;;
+  /**
+   * Saves all @import URLs
+   * @var array
+   * @access private
+   */
+  var $import = array();
+  /**
+   * Saves the namespace
+   * @var string
+   * @access private
+   */
+  var $namespace = &#039;&#039;;
+  /**
+   * Contains the version of csstidy
+   * @var string
+   * @access private
+   */
+  var $version = &#039;1.3&#039;;
+  /**
+   * Stores the settings
+   * @var array
+   * @access private
+   */
+  var $settings = array();
+  /**
+   * Saves the parser-status.
+   *
+   * Possible values:
+   * - is = in selector
+   * - ip = in property
+   * - iv = in value
+   * - instr = in string (started at &quot; or &#039; or ( )
+   * - ic = in comment (ignore everything)
+   * - at = in @-block
+   *
+   * @var string
+   * @access private
+   */
+  var $status = &#039;is&#039;;
+  /**
+   * Saves the current at rule (@media)
+   * @var string
+   * @access private
+   */
+  var $at = &#039;&#039;;
+  /**
+   * Saves the current selector
+   * @var string
+   * @access private
+   */
+  var $selector = &#039;&#039;;
+  /**
+   * Saves the current property
+   * @var string
+   * @access private
+   */
+  var $property = &#039;&#039;;
+  /**
+   * Saves the position of , in selectors
+   * @var array
+   * @access private
+   */
+  var $sel_separate = array();
+  /**
+   * Saves the current value
+   * @var string
+   * @access private
+   */
+  var $value = &#039;&#039;;
+  /**
+   * Saves the current sub-value
+   *
+   * Example for a subvalue:
+   * background:url(foo.png) red no-repeat;
+   * &quot;url(foo.png)&quot;, &quot;red&quot;, and  &quot;no-repeat&quot; are subvalues,
+   * seperated by whitespace
+   * @var string
+   * @access private
+   */
+  var $sub_value = &#039;&#039;;
+  /**
+   * Array which saves all subvalues for a property.
+   * @var array
+   * @see sub_value
+   * @access private
+   */
+  var $sub_value_arr = array();
+  /**
+   * Saves the char which opened the last string
+   * @var string
+   * @access private
+   */
+  var $str_char = &#039;&#039;;
+  var $cur_string = &#039;&#039;;
+  /**
+   * Status from which the parser switched to ic or instr
+   * @var string
+   * @access private
+   */
+  var $from = &#039;&#039;;
+  /**
+   * Variable needed to manage string-in-strings, for example url(&quot;foo.png&quot;)
+   * @var string
+   * @access private
+   */
+  var $str_in_str = false;
+  /**
+   * =true if in invalid at-rule
+   * @var bool
+   * @access private
+   */
+  var $invalid_at = false;
+  /**
+   * =true if something has been added to the current selector
+   * @var bool
+   * @access private
+   */
+  var $added = false;
+  /**
+   * Array which saves the message log
+   * @var array
+   * @access private
+   */
+  var $log = array();
+  /**
+   * Saves the line number
+   * @var integer
+   * @access private
+   */
+  var $line = 1;
+  /**
+   * Marks if we need to leave quotes for a string
+   * @var string
+   * @access private
+   */
+  var $quoted_string = false;
+
+  /**
+   * List of tokens
+   * @var string
+   */
+  var $tokens_list = &quot;&quot;;
+  /**
+   * Loads standard template and sets default settings
+   * @access private
+   * @version 1.3
+   */
+  function csstidy() {
+    $this-&gt;settings[&#039;remove_bslash&#039;] = true;
+    $this-&gt;settings[&#039;compress_colors&#039;] = true;
+    $this-&gt;settings[&#039;compress_font-weight&#039;] = true;
+    $this-&gt;settings[&#039;lowercase_s&#039;] = false;
+    /*
+     1 common shorthands optimization
+     2 + font property optimization
+     3 + background property optimization
+     */
+    $this-&gt;settings[&#039;optimise_shorthands&#039;] = 1;
+    $this-&gt;settings[&#039;remove_last_;&#039;] = true;
+    /* rewrite all properties with low case, better for later gzip OK, safe*/
+    $this-&gt;settings[&#039;case_properties&#039;] = 1;
+    /* sort properties in alpabetic order, better for later gzip
+     * but can cause trouble in case of overiding same propertie or using hack
+     */
+    $this-&gt;settings[&#039;sort_properties&#039;] = false;
+    /*
+     1, 3, 5, etc -- enable sorting selectors inside @media: a{}b{}c{}
+     2, 5, 8, etc -- enable sorting selectors inside one CSS declaration: a,b,c{}
+     preserve order by default cause it can break functionnality
+     */
+    $this-&gt;settings[&#039;sort_selectors&#039;] = 0;
+    /* is dangeroues to be used: CSS is broken sometimes */
+    $this-&gt;settings[&#039;merge_selectors&#039;] = 0;
+    /* preserve or not browser hacks */
+    $this-&gt;settings[&#039;discard_invalid_selectors&#039;] = false;
+    $this-&gt;settings[&#039;discard_invalid_properties&#039;] = false;
+    $this-&gt;settings[&#039;css_level&#039;] = &#039;CSS2.1&#039;;
+    $this-&gt;settings[&#039;preserve_css&#039;] = false;
+    $this-&gt;settings[&#039;timestamp&#039;] = false;
+    $this-&gt;settings[&#039;template&#039;] = &#039;&#039;; // say that propertie exist
+    $this-&gt;set_cfg(&#039;template&#039;, &#039;default&#039;); // call load_template
+    $this-&gt;optimise = new csstidy_optimise($this);
+
+    $this-&gt;tokens_list = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;tokens&#039;];
+  }
+
+  /**
+   * Get the value of a setting.
+   * @param string $setting
+   * @access public
+   * @return mixed
+   * @version 1.0
+   */
+  function get_cfg($setting) {
+    if (isset($this-&gt;settings[$setting])) {
+      return $this-&gt;settings[$setting];
+    }
+    return false;
+  }
+
+  /**
+   * Load a template
+   * @param string $template used by set_cfg to load a template via a configuration setting
+   * @access private
+   * @version 1.4
+   */
+  function _load_template($template) {
+    switch ($template) {
+      case &#039;default&#039;:
+        $this-&gt;load_template(&#039;default&#039;);
+        break;
+
+      case &#039;highest&#039;:
+        $this-&gt;load_template(&#039;highest_compression&#039;);
+        break;
+
+      case &#039;high&#039;:
+        $this-&gt;load_template(&#039;high_compression&#039;);
+        break;
+
+      case &#039;low&#039;:
+        $this-&gt;load_template(&#039;low_compression&#039;);
+        break;
+
+      default:
+        $this-&gt;load_template($template);
+        break;
+    }
+  }
+
+  /**
+   * Set the value of a setting.
+   * @param string $setting
+   * @param mixed $value
+   * @access public
+   * @return bool
+   * @version 1.0
+   */
+  function set_cfg($setting, $value = null) {
+    if (is_array($setting) &amp;&amp; $value === null) {
+      foreach ($setting as $setprop =&gt; $setval) {
+        $this-&gt;settings[$setprop] = $setval;
+      }
+      if (array_key_exists(&#039;template&#039;, $setting)) {
+        $this-&gt;_load_template($this-&gt;settings[&#039;template&#039;]);
+      }
+      return true;
+    }
+    else if (isset($this-&gt;settings[$setting]) &amp;&amp; $value !== &#039;&#039;) {
+      $this-&gt;settings[$setting] = $value;
+      if ($setting === &#039;template&#039;) {
+        $this-&gt;_load_template($this-&gt;settings[&#039;template&#039;]);
+      }
+      return true;
+    }
+    return false;
+  }
+
+  /**
+   * Adds a token to $this-&gt;tokens
+   * @param mixed $type
+   * @param string $data
+   * @param bool $do add a token even if preserve_css is off
+   * @access private
+   * @version 1.0
+   */
+  function _add_token($type, $data, $do = false) {
+    if ($this-&gt;get_cfg(&#039;preserve_css&#039;) || $do) {
+      $this-&gt;tokens[] = array($type, ($type == COMMENT) ? $data : trim($data));
+    }
+  }
+
+  /**
+   * Add a message to the message log
+   * @param string $message
+   * @param string $type
+   * @param integer $line
+   * @access private
+   * @version 1.0
+   */
+  function log($message, $type, $line = -1) {
+    if ($line === -1) {
+      $line = $this-&gt;line;
+    }
+    $line = intval($line);
+    $add = array(
+      &#039;m&#039; =&gt; $message,
+      &#039;t&#039; =&gt; $type,
+    );
+    if (!isset($this-&gt;log[$line]) || !in_array($add, $this-&gt;log[$line])) {
+      $this-&gt;log[$line][] = $add;
+    }
+  }
+
+  /**
+   * Parse unicode notations and find a replacement character
+   * @param string $string
+   * @param integer $i
+   * @access private
+   * @return string
+   * @version 1.2
+   */
+  function _unicode(&amp;$string, &amp;$i) {
+    ++$i;
+    $add = &#039;&#039;;
+    $replaced = false;
+
+    while ($i &lt; strlen($string) &amp;&amp; (ctype_xdigit($string{$i}) || ctype_space($string{$i})) &amp;&amp; strlen($add) &lt; 6) {
+      $add .= $string{$i};
+
+      if (ctype_space($string{$i})) {
+        break;
+      }
+      $i++;
+    }
+
+    if (hexdec($add) &gt; 47 &amp;&amp; hexdec($add) &lt; 58 || hexdec($add) &gt; 64 &amp;&amp; hexdec($add) &lt; 91 || hexdec($add) &gt; 96 &amp;&amp; hexdec($add) &lt; 123) {
+      $this-&gt;log(&#039;Replaced unicode notation: Changed \\&#039; . $add . &#039; to &#039; . chr(hexdec($add)), &#039;Information&#039;);
+      $add = chr(hexdec($add));
+      $replaced = true;
+    }
+    else {
+      $add = trim(&#039;\\&#039; . $add);
+    }
+
+    if (@ctype_xdigit($string{$i + 1}) &amp;&amp; ctype_space($string{$i})
+						 &amp;&amp; !$replaced || !ctype_space($string{$i})) {
+      $i--;
+    }
+
+    if ($add !== &#039;\\&#039; || !$this-&gt;get_cfg(&#039;remove_bslash&#039;) || strpos($this-&gt;tokens_list, $string{$i + 1}) !== false) {
+      return $add;
+    }
+
+    if ($add === &#039;\\&#039;) {
+      $this-&gt;log(&#039;Removed unnecessary backslash&#039;, &#039;Information&#039;);
+    }
+    return &#039;&#039;;
+  }
+
+  /**
+   * Write formatted output to a file
+   * @param string $filename
+   * @param string $doctype when printing formatted, is a shorthand for the document type
+   * @param bool $externalcss when printing formatted, indicates whether styles to be attached internally or as an external stylesheet
+   * @param string $title when printing formatted, is the title to be added in the head of the document
+   * @param string $lang when printing formatted, gives a two-letter language code to be added to the output
+   * @access public
+   * @version 1.4
+   */
+  function write_page($filename, $doctype = &#039;xhtml1.1&#039;, $externalcss = true, $title = &#039;&#039;, $lang = &#039;en&#039;) {
+    $this-&gt;write($filename, true);
+  }
+
+  /**
+   * Write plain output to a file
+   * @param string $filename
+   * @param bool $formatted whether to print formatted or not
+   * @param string $doctype when printing formatted, is a shorthand for the document type
+   * @param bool $externalcss when printing formatted, indicates whether styles to be attached internally or as an external stylesheet
+   * @param string $title when printing formatted, is the title to be added in the head of the document
+   * @param string $lang when printing formatted, gives a two-letter language code to be added to the output
+   * @param bool $pre_code whether to add pre and code tags around the code (for light HTML formatted templates)
+   * @access public
+   * @version 1.4
+   */
+  function write($filename, $formatted = false, $doctype = &#039;xhtml1.1&#039;, $externalcss = true, $title = &#039;&#039;, $lang = &#039;en&#039;, $pre_code = true) {
+    $filename .= ( $formatted) ? &#039;.xhtml&#039; : &#039;.css&#039;;
+
+    if (!is_dir(&#039;temp&#039;)) {
+      $madedir = mkdir(&#039;temp&#039;);
+      if (!$madedir) {
+        print &#039;Could not make directory &quot;temp&quot; in &#039; . dirname(__FILE__);
+        exit;
+      }
+    }
+    $handle = fopen(&#039;temp/&#039; . $filename, &#039;w&#039;);
+    if ($handle) {
+      if (!$formatted) {
+        fwrite($handle, $this-&gt;print-&gt;plain());
+      }
+      else {
+        fwrite($handle, $this-&gt;print-&gt;formatted_page($doctype, $externalcss, $title, $lang, $pre_code));
+      }
+    }
+    fclose($handle);
+  }
+
+  /**
+   * Loads a new template
+   * @param string $content either filename (if $from_file == true), content of a template file, &quot;high_compression&quot;, &quot;highest_compression&quot;, &quot;low_compression&quot;, or &quot;default&quot;
+   * @param bool $from_file uses $content as filename if true
+   * @access public
+   * @version 1.1
+   * @see http://csstidy.sourceforge.net/templates.php
+   */
+  function load_template($content, $from_file = true) {
+    $predefined_templates = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;];
+    if ($content === &#039;high_compression&#039; || $content === &#039;default&#039; || $content === &#039;highest_compression&#039; || $content === &#039;low_compression&#039;) {
+      $this-&gt;template = $predefined_templates[$content];
+      return;
+    }
+
+
+    if ($from_file) {
+      $content = strip_tags(file_get_contents($content), &#039;&lt;span&gt;&#039;);
+    }
+    $content = str_replace(&quot;\r\n&quot;, &quot;\n&quot;, $content); // Unify newlines (because the output also only uses \n)
+    $template = explode(&#039;|&#039;, $content);
+
+    for ($i = 0; $i &lt; count($template); $i++) {
+      $this-&gt;template[$i] = $template[$i];
+    }
+  }
+
+  /**
+   * Starts parsing from URL
+   * @param string $url
+   * @access public
+   * @version 1.0
+   */
+  function parse_from_url($url) {
+    return $this-&gt;parse(@file_get_contents($url));
+  }
+
+  /**
+   * Checks if there is a token at the current position
+   * @param string $string
+   * @param integer $i
+   * @access public
+   * @version 1.11
+   */
+  function is_token(&amp;$string, $i) {
+    return (strpos($this-&gt;tokens_list, $string{$i}) !== false &amp;&amp; !csstidy::escaped($string, $i));
+  }
+
+  /**
+   * Parses CSS in $string. The code is saved as array in $this-&gt;css
+   * @param string $string the CSS code
+   * @access public
+   * @return bool
+   * @version 1.1
+   */
+  function parse($string) {
+    // Temporarily set locale to en_US in order to handle floats properly
+    $old = @setlocale(LC_ALL, 0);
+    @setlocale(LC_ALL, &#039;C&#039;);
+
+    // PHP bug? Settings need to be refreshed in PHP4
+    $this-&gt;print = new csstidy_print($this);
+    $this-&gt;optimise = new csstidy_optimise($this);
+
+    $all_properties = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;all_properties&#039;];
+    $at_rules = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;at_rules&#039;];
+
+    $this-&gt;css = array();
+    $this-&gt;print-&gt;input_css = $string;
+    $string = str_replace(&quot;\r\n&quot;, &quot;\n&quot;, $string) . &#039; &#039;;
+    $cur_comment = &#039;&#039;;
+
+    for ($i = 0, $size = strlen($string); $i &lt; $size; $i++) {
+      if ($string{$i} === &quot;\n&quot; || $string{$i} === &quot;\r&quot;) {
+        ++$this-&gt;line;
+      }
+
+      switch ($this-&gt;status) {
+        /* Case in at-block */
+        case &#039;at&#039;:
+          if (csstidy::is_token($string, $i)) {
+            if ($string{$i} === &#039;/&#039; &amp;&amp; @$string{$i + 1} === &#039;*&#039;) {
+              $this-&gt;status = &#039;ic&#039;;
+              ++$i;
+              $this-&gt;from = &#039;at&#039;;
+            }
+            elseif ($string{$i} === &#039;{&#039;) {
+              $this-&gt;status = &#039;is&#039;;
+              $this-&gt;at = $this-&gt;css_new_media_section($this-&gt;at);
+              $this-&gt;_add_token(AT_START, $this-&gt;at);
+            }
+            elseif ($string{$i} === &#039;,&#039;) {
+              $this-&gt;at = trim($this-&gt;at) . &#039;,&#039;;
+            }
+            elseif ($string{$i} === &#039;\\&#039;) {
+              $this-&gt;at .= $this-&gt;_unicode($string, $i);
+            }
+            // fix for complicated media, i.e @media screen and (-webkit-min-device-pixel-ratio:0)
+            elseif (in_array($string{$i}, array(&#039;(&#039;, &#039;)&#039;, &#039;:&#039;))) {
+              $this-&gt;at .= $string{$i};
+            }
+          }
+          else {
+            $lastpos = strlen($this-&gt;at) - 1;
+            if (!( (ctype_space($this-&gt;at{$lastpos}) || csstidy::is_token($this-&gt;at, $lastpos) &amp;&amp; $this-&gt;at{$lastpos} === &#039;,&#039;) &amp;&amp; ctype_space($string{$i}))) {
+              $this-&gt;at .= $string{$i};
+            }
+          }
+          break;
+
+          /* Case in-selector */
+        case &#039;is&#039;:
+          if (csstidy::is_token($string, $i)) {
+            if ($string{$i} === &#039;/&#039; &amp;&amp; @$string{$i + 1} === &#039;*&#039; &amp;&amp; trim($this-&gt;selector) == &#039;&#039;) {
+              $this-&gt;status = &#039;ic&#039;;
+              ++$i;
+              $this-&gt;from = &#039;is&#039;;
+            }
+            elseif ($string{$i} === &#039;@&#039; &amp;&amp; trim($this-&gt;selector) == &#039;&#039;) {
+              // Check for at-rule
+              $this-&gt;invalid_at = true;
+              foreach ($at_rules as $name =&gt; $type) {
+                if (!strcasecmp(substr($string, $i + 1, strlen($name)), $name)) {
+                  ($type === &#039;at&#039;) ? $this-&gt;at = &#039;@&#039; . $name : $this-&gt;selector = &#039;@&#039; . $name;
+                  $this-&gt;status = $type;
+                  $i += strlen($name);
+                  $this-&gt;invalid_at = false;
+                }
+              }
+
+              if ($this-&gt;invalid_at) {
+                $this-&gt;selector = &#039;@&#039;;
+                $invalid_at_name = &#039;&#039;;
+                for ($j = $i + 1; $j &lt; $size; ++$j) {
+                  if (!ctype_alpha($string{$j})) {
+                    break;
+                  }
+                  $invalid_at_name .= $string{$j};
+                }
+                $this-&gt;log(&#039;Invalid @-rule: &#039; . $invalid_at_name . &#039; (removed)&#039;, &#039;Warning&#039;);
+              }
+            }
+            elseif (($string{$i} === &#039;&quot;&#039; || $string{$i} === &quot;&#039;&quot;)) {
+              $this-&gt;cur_string = $string{$i};
+              $this-&gt;status = &#039;instr&#039;;
+              $this-&gt;str_char = $string{$i};
+              $this-&gt;from = &#039;is&#039;;
+              /* fixing CSS3 attribute selectors, i.e. a[href$=&quot;.mp3&quot; */
+              $this-&gt;quoted_string = ($string{$i - 1} == &#039;=&#039; );
+            }
+            elseif ($this-&gt;invalid_at &amp;&amp; $string{$i} === &#039;;&#039;) {
+              $this-&gt;invalid_at = false;
+              $this-&gt;status = &#039;is&#039;;
+            }
+            elseif ($string{$i} === &#039;{&#039;) {
+              $this-&gt;status = &#039;ip&#039;;
+              if ($this-&gt;at == &#039;&#039;) {
+                $this-&gt;at = $this-&gt;css_new_media_section(DEFAULT_AT);
+              }
+              $this-&gt;selector = $this-&gt;css_new_selector($this-&gt;at, $this-&gt;selector);
+              $this-&gt;_add_token(SEL_START, $this-&gt;selector);
+              $this-&gt;added = false;
+            }
+            elseif ($string{$i} === &#039;}&#039;) {
+              $this-&gt;_add_token(AT_END, $this-&gt;at);
+              $this-&gt;at = &#039;&#039;;
+              $this-&gt;selector = &#039;&#039;;
+              $this-&gt;sel_separate = array();
+            }
+            elseif ($string{$i} === &#039;,&#039;) {
+              $this-&gt;selector = trim($this-&gt;selector) . &#039;,&#039;;
+              $this-&gt;sel_separate[] = strlen($this-&gt;selector);
+            }
+            elseif ($string{$i} === &#039;\\&#039;) {
+              $this-&gt;selector .= $this-&gt;_unicode($string, $i);
+            }
+            elseif ($string{$i} === &#039;*&#039; &amp;&amp; @in_array($string{$i + 1}, array(&#039;.&#039;, &#039;#&#039;, &#039;[&#039;, &#039;:&#039;))) {
+              // remove unnecessary universal selector, FS#147
+            }
+            else {
+              $this-&gt;selector .= $string{$i};
+            }
+          }
+          else {
+            $lastpos = strlen($this-&gt;selector) - 1;
+            if ($lastpos == -1 || !( (ctype_space($this-&gt;selector{$lastpos}) || csstidy::is_token($this-&gt;selector, $lastpos) &amp;&amp; $this-&gt;selector{$lastpos} === &#039;,&#039;) &amp;&amp; ctype_space($string{$i}))) {
+              $this-&gt;selector .= $string{$i};
+            }
+          }
+          break;
+
+          /* Case in-property */
+        case &#039;ip&#039;:
+          if (csstidy::is_token($string, $i)) {
+            if (($string{$i} === &#039;:&#039; || $string{$i} === &#039;=&#039;) &amp;&amp; $this-&gt;property != &#039;&#039;) {
+              $this-&gt;status = &#039;iv&#039;;
+              if (!$this-&gt;get_cfg(&#039;discard_invalid_properties&#039;) || csstidy::property_is_valid($this-&gt;property)) {
+                $this-&gt;property = $this-&gt;css_new_property($this-&gt;at, $this-&gt;selector, $this-&gt;property);
+                $this-&gt;_add_token(PROPERTY, $this-&gt;property);
+              }
+            }
+            elseif ($string{$i} === &#039;/&#039; &amp;&amp; @$string{$i + 1} === &#039;*&#039; &amp;&amp; $this-&gt;property == &#039;&#039;) {
+              $this-&gt;status = &#039;ic&#039;;
+              ++$i;
+              $this-&gt;from = &#039;ip&#039;;
+            }
+            elseif ($string{$i} === &#039;}&#039;) {
+              $this-&gt;explode_selectors();
+              $this-&gt;status = &#039;is&#039;;
+              $this-&gt;invalid_at = false;
+              $this-&gt;_add_token(SEL_END, $this-&gt;selector);
+              $this-&gt;selector = &#039;&#039;;
+              $this-&gt;property = &#039;&#039;;
+            }
+            elseif ($string{$i} === &#039;;&#039;) {
+              $this-&gt;property = &#039;&#039;;
+            }
+            elseif ($string{$i} === &#039;\\&#039;) {
+              $this-&gt;property .= $this-&gt;_unicode($string, $i);
+            }
+            // else this is dumb IE a hack, keep it
+            elseif ($this-&gt;property == &#039;&#039; AND !ctype_space($string{$i})) {
+              $this-&gt;property .= $string{$i};
+            }
+          }
+          elseif (!ctype_space($string{$i})) {
+            $this-&gt;property .= $string{$i};
+          }
+          break;
+
+          /* Case in-value */
+        case &#039;iv&#039;:
+          $pn = (($string{$i} === &quot;\n&quot; || $string{$i} === &quot;\r&quot;) &amp;&amp; $this-&gt;property_is_next($string, $i + 1) || $i == strlen($string) - 1);
+          if (csstidy::is_token($string, $i) || $pn) {
+            if ($string{$i} === &#039;/&#039; &amp;&amp; @$string{$i + 1} === &#039;*&#039;) {
+              $this-&gt;status = &#039;ic&#039;;
+              ++$i;
+              $this-&gt;from = &#039;iv&#039;;
+            }
+            elseif (($string{$i} === &#039;&quot;&#039; || $string{$i} === &quot;&#039;&quot; || $string{$i} === &#039;(&#039;)) {
+              $this-&gt;cur_string = $string{$i};
+              $this-&gt;str_char = ($string{$i} === &#039;(&#039;) ? &#039;)&#039; : $string{$i};
+              $this-&gt;status = &#039;instr&#039;;
+              $this-&gt;from = &#039;iv&#039;;
+            }
+            elseif ($string{$i} === &#039;,&#039;) {
+              $this-&gt;sub_value = trim($this-&gt;sub_value) . &#039;,&#039;;
+            }
+            elseif ($string{$i} === &#039;\\&#039;) {
+              $this-&gt;sub_value .= $this-&gt;_unicode($string, $i);
+            }
+            elseif ($string{$i} === &#039;;&#039; || $pn) {
+              if ($this-&gt;selector{0} === &#039;@&#039; &amp;&amp; isset($at_rules[substr($this-&gt;selector, 1)]) &amp;&amp; $at_rules[substr($this-&gt;selector, 1)] === &#039;iv&#039;) {
+                /* Add quotes to charset, import, namespace */
+                $this-&gt;sub_value_arr[] = &#039;&quot;&#039; . trim($this-&gt;sub_value) . &#039;&quot;&#039;;
+
+                $this-&gt;status = &#039;is&#039;;
+
+                switch ($this-&gt;selector) {
+                  case &#039;@charset&#039;:
+                    $this-&gt;charset = $this-&gt;sub_value_arr[0];
+                    break;
+                  case &#039;@namespace&#039;:
+                    $this-&gt;namespace = implode(&#039; &#039;, $this-&gt;sub_value_arr);
+                    break;
+                  case &#039;@import&#039;:
+                    $this-&gt;import[] = implode(&#039; &#039;, $this-&gt;sub_value_arr);
+                    break;
+                }
+
+                $this-&gt;sub_value_arr = array();
+                $this-&gt;sub_value = &#039;&#039;;
+                $this-&gt;selector = &#039;&#039;;
+                $this-&gt;sel_separate = array();
+              }
+              else {
+                $this-&gt;status = &#039;ip&#039;;
+              }
+            }
+            elseif ($string{$i} !== &#039;}&#039;) {
+              $this-&gt;sub_value .= $string{$i};
+            }
+            if (($string{$i} === &#039;}&#039; || $string{$i} === &#039;;&#039; || $pn) &amp;&amp; !empty($this-&gt;selector)) {
+              if ($this-&gt;at == &#039;&#039;) {
+                $this-&gt;at = $this-&gt;css_new_media_section(DEFAULT_AT);
+              }
+
+              // case settings
+              if ($this-&gt;get_cfg(&#039;lowercase_s&#039;)) {
+                $this-&gt;selector = strtolower($this-&gt;selector);
+              }
+              $this-&gt;property = strtolower($this-&gt;property);
+
+              $this-&gt;optimise-&gt;subvalue();
+              if ($this-&gt;sub_value != &#039;&#039;) {
+                /* original, disabled for fix below
+                 if (substr($this-&gt;sub_value, 0, 6) == &#039;format&#039;) {
+                 $this-&gt;sub_value = str_replace(array(&#039;format(&#039;, &#039;)&#039;), array(&#039;format(&quot;&#039;, &#039;&quot;)&#039;), $this-&gt;sub_value);
+                 }//*/
+                $this-&gt;sub_value_arr[] = $this-&gt;sub_value;
+                // [FIX] @font-face with multiple fonts and CSSTidy
+                // (http://www.pixelastic.com/blog/86:csstidy-and-the-woff-fonts)
+                foreach ($this-&gt;sub_value_arr as $sub_value) {
+                  if (substr($sub_value, 0, 6) == &#039;format&#039;) {
+                    $sub_value = str_replace(array(&#039;format(&#039;, &#039;)&#039;), array(&#039;format(&quot;&#039;, &#039;&quot;)&#039;), $sub_value);
+                  }
+                }
+                $this-&gt;sub_value = &#039;&#039;;
+              }
+
+              $this-&gt;value = array_shift($this-&gt;sub_value_arr);
+              while (count($this-&gt;sub_value_arr)) {
+                $this-&gt;value .= (substr($this-&gt;value, -1, 1) == &#039;,&#039; ? &#039;&#039; : &#039; &#039;) . array_shift($this-&gt;sub_value_arr);
+              }
+
+              $this-&gt;optimise-&gt;value();
+
+              $valid = csstidy::property_is_valid($this-&gt;property);
+              if ((!$this-&gt;invalid_at || $this-&gt;get_cfg(&#039;preserve_css&#039;)) &amp;&amp; (!$this-&gt;get_cfg(&#039;discard_invalid_properties&#039;) || $valid)) {
+                $this-&gt;css_add_property($this-&gt;at, $this-&gt;selector, $this-&gt;property, $this-&gt;value);
+                $this-&gt;_add_token(VALUE, $this-&gt;value);
+                $this-&gt;optimise-&gt;shorthands();
+              }
+              if (!$valid) {
+                if ($this-&gt;get_cfg(&#039;discard_invalid_properties&#039;)) {
+                  $this-&gt;log(&#039;Removed invalid property: &#039; . $this-&gt;property, &#039;Warning&#039;);
+                }
+                else {
+                  $this-&gt;log(&#039;Invalid property in &#039; . strtoupper($this-&gt;get_cfg(&#039;css_level&#039;)) . &#039;: &#039; . $this-&gt;property, &#039;Warning&#039;);
+                }
+              }
+
+              $this-&gt;property = &#039;&#039;;
+              $this-&gt;sub_value_arr = array();
+              $this-&gt;value = &#039;&#039;;
+            }
+            if ($string{$i} === &#039;}&#039;) {
+              $this-&gt;explode_selectors();
+              $this-&gt;_add_token(SEL_END, $this-&gt;selector);
+              $this-&gt;status = &#039;is&#039;;
+              $this-&gt;invalid_at = false;
+              $this-&gt;selector = &#039;&#039;;
+            }
+          }
+          elseif (!$pn) {
+            $this-&gt;sub_value .= $string{$i};
+
+            if (ctype_space($string{$i})) {
+              $this-&gt;optimise-&gt;subvalue();
+              if ($this-&gt;sub_value != &#039;&#039;) {
+                $this-&gt;sub_value_arr[] = $this-&gt;sub_value;
+                $this-&gt;sub_value = &#039;&#039;;
+              }
+            }
+          }
+          break;
+
+          /* Case in string */
+        case &#039;instr&#039;:
+          if ($this-&gt;str_char === &#039;)&#039; &amp;&amp; ($string{$i} === &#039;&quot;&#039; || $string{$i} === &#039;\&#039;&#039;) &amp;&amp; !$this-&gt;str_in_str &amp;&amp; !csstidy::escaped($string, $i)) {
+            $this-&gt;str_in_str = true;
+          }
+          elseif ($this-&gt;str_char === &#039;)&#039; &amp;&amp; ($string{$i} === &#039;&quot;&#039; || $string{$i} === &#039;\&#039;&#039;) &amp;&amp; $this-&gt;str_in_str &amp;&amp; !csstidy::escaped($string, $i)) {
+            $this-&gt;str_in_str = false;
+          }
+          $temp_add = $string{$i}; // ...and no not-escaped backslash at the previous position
+          if (($string{$i} === &quot;\n&quot; || $string{$i} === &quot;\r&quot;) &amp;&amp; !($string{$i - 1} === &#039;\\&#039; &amp;&amp; !csstidy::escaped($string, $i - 1))) {
+            $temp_add = &quot;\\A &quot;;
+            $this-&gt;log(&#039;Fixed incorrect newline in string&#039;, &#039;Warning&#039;);
+          }
+          // this optimisation remove space in css3 properties (see vendor-prefixed/webkit-gradient.csst)
+          #if (!($this-&gt;str_char === &#039;)&#039; &amp;&amp; in_array($string{$i}, $GLOBALS[&#039;csstidy&#039;][&#039;whitespace&#039;]) &amp;&amp; !$this-&gt;str_in_str)) {
+          $this-&gt;cur_string .= $temp_add;
+          #}
+          if ($string{$i} == $this-&gt;str_char &amp;&amp; !csstidy::escaped($string, $i) &amp;&amp; !$this-&gt;str_in_str) {
+            $this-&gt;status = $this-&gt;from;
+            if (!preg_match(&#039;|[&#039; . implode(&#039;&#039;, $GLOBALS[&#039;csstidy&#039;][&#039;whitespace&#039;]) . &#039;]|uis&#039;, $this-&gt;cur_string) &amp;&amp; $this-&gt;property !== &#039;content&#039;) {
+              if (!$this-&gt;quoted_string) {
+                if ($this-&gt;str_char === &#039;&quot;&#039; || $this-&gt;str_char === &#039;\&#039;&#039;) {
+                  // Temporarily disable this optimization to avoid problems with @charset rule, quote properties, and some attribute selectors...
+                  // Attribute selectors fixed, added quotes to @chartset, no problems with properties detected. Enabled
+                  $this-&gt;cur_string = substr($this-&gt;cur_string, 1, -1);
+                }
+                else if (strlen($this-&gt;cur_string) &gt; 3 &amp;&amp; ($this-&gt;cur_string[1] === &#039;&quot;&#039; || $this-&gt;cur_string[1] === &#039;\&#039;&#039;)) {
+                  $this-&gt;cur_string = $this-&gt;cur_string[0] . substr($this-&gt;cur_string, 2, -2) . substr($this-&gt;cur_string, -1);
+                }
+              }
+              else {
+                $this-&gt;quoted_string = false;
+              }
+            }
+            if ($this-&gt;from === &#039;iv&#039;) {
+              if (!$this-&gt;quoted_string) {
+                if (strpos($this-&gt;cur_string, &#039;,&#039;) !== false) { // we can on only remove space next to &#039;,&#039;
+                  $this-&gt;cur_string = implode(&#039;,&#039;, array_map(&#039;trim&#039;, explode(&#039;,&#039;, $this-&gt;cur_string)));
+                }
+                // and multiple spaces (too expensive)
+                if (strpos($this-&gt;cur_string, &#039;  &#039;) !== false) {
+                  $this-&gt;cur_string = preg_replace(&quot;,\s+,&quot;, &quot; &quot;, $this-&gt;cur_string);
+                }
+              }
+              $this-&gt;sub_value .= $this-&gt;cur_string;
+            }
+            elseif ($this-&gt;from === &#039;is&#039;) {
+              $this-&gt;selector .= $this-&gt;cur_string;
+            }
+          }
+          break;
+
+          /* Case in-comment */
+        case &#039;ic&#039;:
+          if ($string{$i} === &#039;*&#039; &amp;&amp; $string{$i + 1} === &#039;/&#039;) {
+            $this-&gt;status = $this-&gt;from;
+            $i++;
+            $this-&gt;_add_token(COMMENT, $cur_comment);
+            $cur_comment = &#039;&#039;;
+          }
+          else {
+            $cur_comment .= $string{$i};
+          }
+          break;
+      }
+    }
+
+    $this-&gt;optimise-&gt;postparse();
+
+    $this-&gt;print-&gt;_reset();
+
+    @setlocale(LC_ALL, $old); // Set locale back to original setting
+
+    return;
+    (empty($this-&gt;css) &amp;&amp; empty($this-&gt;import) &amp;&amp; empty($this-&gt;charset) &amp;&amp; empty($this-&gt;tokens) &amp;&amp; empty($this-&gt;namespace));
+  }
+
+  /**
+   * Explodes selectors
+   * @access private
+   * @version 1.0
+   */
+  function explode_selectors() {
+    // Explode multiple selectors
+    if ($this-&gt;get_cfg(&#039;merge_selectors&#039;) === 1) {
+      $new_sels = array();
+      $lastpos = 0;
+      $this-&gt;sel_separate[] = strlen($this-&gt;selector);
+      foreach ($this-&gt;sel_separate as $num =&gt; $pos) {
+        if ($num == count($this-&gt;sel_separate) - 1) {
+          $pos += 1;
+        }
+
+        $new_sels[] = substr($this-&gt;selector, $lastpos, $pos - $lastpos - 1);
+        $lastpos = $pos;
+      }
+
+      if (count($new_sels) &gt; 1) {
+        foreach ($new_sels as $selector) {
+          if (isset($this-&gt;css[$this-&gt;at][$this-&gt;selector])) {
+            $this-&gt;merge_css_blocks($this-&gt;at, $selector, $this-&gt;css[$this-&gt;at][$this-&gt;selector]);
+          }
+        }
+        unset($this-&gt;css[$this-&gt;at][$this-&gt;selector]);
+      }
+    }
+    $this-&gt;sel_separate = array();
+  }
+
+  /**
+   * Checks if a character is escaped (and returns true if it is)
+   * @param string $string
+   * @param integer $pos
+   * @access public
+   * @return bool
+   * @version 1.02
+   */
+  static function escaped(&amp;$string, $pos) {
+    return;
+    (@($string{$pos - 1} !== &#039;\\&#039;) || csstidy::escaped($string, $pos - 1));
+  }
+
+  /**
+   * Adds a property with value to the existing CSS code
+   * @param string $media
+   * @param string $selector
+   * @param string $property
+   * @param string $new_val
+   * @access private
+   * @version 1.2
+   */
+  function css_add_property($media, $selector, $property, $new_val) {
+    if ($this-&gt;get_cfg(&#039;preserve_css&#039;) || trim($new_val) == &#039;&#039;) {
+      return;
+    }
+
+    $this-&gt;added = true;
+    if (isset($this-&gt;css[$media][$selector][$property])) {
+      if ((csstidy::is_important($this-&gt;css[$media][$selector][$property]) &amp;&amp; csstidy::is_important($new_val)) || !csstidy::is_important($this-&gt;css[$media][$selector][$property])) {
+        $this-&gt;css[$media][$selector][$property] = trim($new_val);
+      }
+    }
+    else {
+      $this-&gt;css[$media][$selector][$property] = trim($new_val);
+    }
+  }
+
+  /**
+   * Start a new media section.
+   * Check if the media is not already known,
+   * else rename it with extra spaces
+   * to avoid merging
+   *
+   * @param string $media
+   * @return string
+   */
+  function css_new_media_section($media) {
+    if ($this-&gt;get_cfg(&#039;preserve_css&#039;)) {
+      return $media;
+    }
+
+    // if the last @media is the same as this
+    // keep it
+    if (!$this-&gt;css OR !is_array($this-&gt;css) OR empty($this-&gt;css)) {
+      return $media;
+    }
+    end($this-&gt;css);
+    list($at, ) = each($this-&gt;css);
+    if ($at == $media) {
+      return $media;
+    }
+    while (isset($this-&gt;css[$media])) {
+      if (is_numeric($media)) {
+        $media++;
+      }
+    }
+    else {
+      $media .= &quot; &quot;;
+    }
+    return $media;
+  }
+
+  /**
+   * Start a new selector.
+   * If already referenced in this media section,
+   * rename it with extra space to avoid merging
+   * except if merging is required,
+   * or last selector is the same (merge siblings)
+   *
+   * never merge @font-face
+   *
+   * @param string $media
+   * @param string $selector
+   * @return string
+   */
+  function css_new_selector($media, $selector) {
+    if ($this-&gt;get_cfg(&#039;preserve_css&#039;)) {
+      return $selector;
+    }
+    $selector = trim($selector);
+    if (strncmp($selector, &quot;@font-face&quot;, 10) != 0) {
+      if ($this-&gt;settings[&#039;merge_selectors&#039;] != false) {
+        return $selector;
+      }
+
+      if (!$this-&gt;css OR !isset($this-&gt;css[$media]) OR !$this-&gt;css[$media]) {
+        return $selector;
+      }
+
+      // if last is the same, keep it
+      end($this-&gt;css[$media]);
+      list($sel, ) = each($this-&gt;css[$media]);
+      if ($sel == $selector) {
+        return $selector;
+      }
+    }
+
+    while (isset($this-&gt;css[$media][$selector])) {
+      $selector .= &quot; &quot;;
+    }
+    return $selector;
+  }
+
+  /**
+   * Start a new propertie.
+   * If already references in this selector,
+   * rename it with extra space to avoid override
+   *
+   * @param string $media
+   * @param string $selector
+   * @param string $property
+   * @return string
+   */
+  function css_new_property($media, $selector, $property) {
+    if ($this-&gt;get_cfg(&#039;preserve_css&#039;)) {
+      return $property;
+    }
+    if (!$this-&gt;css OR !isset($this-&gt;css[$media][$selector]) OR !$this-&gt;css[$media][$selector]) {
+      return $property;
+    }
+
+    while (isset($this-&gt;css[$media][$selector][$property])) {
+      $property .= &quot; &quot;;
+    }
+
+    return $property;
+  }
+
+  /**
+   * Adds CSS to an existing media/selector
+   * @param string $media
+   * @param string $selector
+   * @param array $css_add
+   * @access private
+   * @version 1.1
+   */
+  function merge_css_blocks($media, $selector, $css_add) {
+    foreach ($css_add as $property =&gt; $value) {
+      $this-&gt;css_add_property($media, $selector, $property, $value, false);
+    }
+  }
+
+  /**
+   * Checks if $value is !important.
+   * @param string $value
+   * @return bool
+   * @access public
+   * @version 1.0
+   */
+  static function is_important(&amp;$value) {
+    return (!strcasecmp(substr(str_replace($GLOBALS[&#039;csstidy&#039;][&#039;whitespace&#039;], &#039;&#039;, $value), -10, 10), &#039;!important&#039;));
+  }
+
+  /**
+   * Returns a value without !important
+   * @param string $value
+   * @return string
+   * @access public
+   * @version 1.0
+   */
+  static function gvw_important($value) {
+    if (csstidy::is_important($value)) {
+      $value = trim($value);
+      $value = substr($value, 0, -9);
+      $value = trim($value);
+      $value = substr($value, 0, -1);
+      $value = trim($value);
+      return $value;
+    }
+    return $value;
+  }
+
+  /**
+   * Checks if the next word in a string from pos is a CSS property
+   * @param string $istring
+   * @param integer $pos
+   * @return bool
+   * @access private
+   * @version 1.2
+   */
+  function property_is_next($istring, $pos) {
+    $all_properties = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;all_properties&#039;];
+    $istring = substr($istring, $pos, strlen($istring) - $pos);
+    $pos = strpos($istring, &#039;:&#039;);
+    if ($pos === false) {
+      return false;
+    }
+    $istring = strtolower(trim(substr($istring, 0, $pos)));
+    if (isset($all_properties[$istring])) {
+      $this-&gt;log(&#039;Added semicolon to the end of declaration&#039;, &#039;Warning&#039;);
+      return true;
+    }
+    return false;
+  }
+
+  /**
+   * Checks if a property is valid
+   * @param string $property
+   * @return bool;
+   * @access public
+   * @version 1.0
+   */
+  function property_is_valid($property) {
+    $all_properties = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;all_properties&#039;];
+    return (isset($all_properties[$property]) &amp;&amp; strpos($all_properties[$property], strtoupper($this-&gt;get_cfg(&#039;css_level&#039;))) !== false );
+  }
 
 }
diff -up -r advagg_css_compress/csstidy/class.csstidy_ctype.inc advagg_css_compress/csstidy/class.csstidy_ctype.inc
--- advagg_css_compress/csstidy/class.csstidy_ctype.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/csstidy/class.csstidy_ctype.inc	2012-03-23 13:02:20.000000000 -0600
@@ -30,16 +30,17 @@
 /* ctype_space  Check for whitespace character(s) */
 if (!function_exists(&#039;ctype_space&#039;)) {
 
-	function ctype_space($text) {
-		return!preg_match(&quot;/[^\s\r\n\t\f]/&quot;, $text);
-	}
+  function ctype_space($text) {
+    return;
+    preg_match(&quot;/[^\s\r\n\t\f]/&quot;, $text);
+  }
 
 }
 /* ctype_alpha  Check for alphabetic character(s) */
 if (!function_exists(&#039;ctype_alpha&#039;)) {
 
-	function ctype_alpha($text) {
-		return preg_match(&quot;/[a-zA-Z]/&quot;, $text);
-	}
+  function ctype_alpha($text) {
+    return preg_match(&quot;/[a-zA-Z]/&quot;, $text);
+  }
 
 }
diff -up -r advagg_css_compress/csstidy/class.csstidy_optimise.inc advagg_css_compress/csstidy/class.csstidy_optimise.inc
--- advagg_css_compress/csstidy/class.csstidy_optimise.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/csstidy/class.csstidy_optimise.inc	2012-03-23 13:02:21.000000000 -0600
@@ -19,7 +19,7 @@
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *   GNU Lesser General Public License for more details.
- * 
+ *
  *   You should have received a copy of the GNU Lesser General Public License
  *   along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
  *
@@ -41,891 +41,972 @@
  */
 class csstidy_optimise {
 
-	/**
-	 * Constructor
-	 * @param array $css contains the class csstidy
-	 * @access private
-	 * @version 1.0
-	 */
-	function csstidy_optimise(&amp;$css) {
-		$this-&gt;parser = &amp; $css;
-		$this-&gt;css = &amp; $css-&gt;css;
-		$this-&gt;sub_value = &amp; $css-&gt;sub_value;
-		$this-&gt;at = &amp; $css-&gt;at;
-		$this-&gt;selector = &amp; $css-&gt;selector;
-		$this-&gt;property = &amp; $css-&gt;property;
-		$this-&gt;value = &amp; $css-&gt;value;
-	}
-
-	/**
-	 * Optimises $css after parsing
-	 * @access public
-	 * @version 1.0
-	 */
-	function postparse() {
-		if ($this-&gt;parser-&gt;get_cfg(&#039;preserve_css&#039;)) {
-			return;
-		}
-
-		if ($this-&gt;parser-&gt;get_cfg(&#039;merge_selectors&#039;) === 2) {
-			foreach ($this-&gt;css as $medium =&gt; $value) {
-				$this-&gt;merge_selectors($this-&gt;css[$medium]);
-			}
-		}
-
-		if ($this-&gt;parser-&gt;get_cfg(&#039;discard_invalid_selectors&#039;)) {
-			foreach ($this-&gt;css as $medium =&gt; $value) {
-				$this-&gt;discard_invalid_selectors($this-&gt;css[$medium]);
-			}
-		}
-
-		if ($this-&gt;parser-&gt;get_cfg(&#039;optimise_shorthands&#039;) &gt; 0) {
-			foreach ($this-&gt;css as $medium =&gt; $value) {
-				foreach ($value as $selector =&gt; $value1) {
-					$this-&gt;css[$medium][$selector] = csstidy_optimise::merge_4value_shorthands($this-&gt;css[$medium][$selector]);
-
-					if ($this-&gt;parser-&gt;get_cfg(&#039;optimise_shorthands&#039;) &lt; 2) {
-						continue;
-					}
-
-					$this-&gt;css[$medium][$selector] = csstidy_optimise::merge_font($this-&gt;css[$medium][$selector]);
-
-					if ($this-&gt;parser-&gt;get_cfg(&#039;optimise_shorthands&#039;) &lt; 3) {
-						continue;
-					}
-
-					$this-&gt;css[$medium][$selector] = csstidy_optimise::merge_bg($this-&gt;css[$medium][$selector]);
-					if (empty($this-&gt;css[$medium][$selector])) {
-						unset($this-&gt;css[$medium][$selector]);
-					}
-				}
-			}
-		}
-	}
-
-	/**
-	 * Optimises values
-	 * @access public
-	 * @version 1.0
-	 */
-	function value() {
-		$shorthands = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;];
-
-		// optimise shorthand properties
-		if (isset($shorthands[$this-&gt;property])) {
-			$temp = csstidy_optimise::shorthand($this-&gt;value); // FIXME - move
-			if ($temp != $this-&gt;value) {
-				$this-&gt;parser-&gt;log(&#039;Optimised shorthand notation (&#039; . $this-&gt;property . &#039;): Changed &quot;&#039; . $this-&gt;value . &#039;&quot; to &quot;&#039; . $temp . &#039;&quot;&#039;, &#039;Information&#039;);
-			}
-			$this-&gt;value = $temp;
-		}
-
-		// Remove whitespace at ! important
-		if ($this-&gt;value != $this-&gt;compress_important($this-&gt;value)) {
-			$this-&gt;parser-&gt;log(&#039;Optimised !important&#039;, &#039;Information&#039;);
-		}
-	}
-
-	/**
-	 * Optimises shorthands
-	 * @access public
-	 * @version 1.0
-	 */
-	function shorthands() {
-		$shorthands = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;];
-
-		if (!$this-&gt;parser-&gt;get_cfg(&#039;optimise_shorthands&#039;) || $this-&gt;parser-&gt;get_cfg(&#039;preserve_css&#039;)) {
-			return;
-		}
-
-		if ($this-&gt;property === &#039;font&#039; &amp;&amp; $this-&gt;parser-&gt;get_cfg(&#039;optimise_shorthands&#039;) &gt; 1) {
-			$this-&gt;css[$this-&gt;at][$this-&gt;selector][&#039;font&#039;]=&#039;&#039;;
-			$this-&gt;parser-&gt;merge_css_blocks($this-&gt;at, $this-&gt;selector, csstidy_optimise::dissolve_short_font($this-&gt;value));
-		}
-		if ($this-&gt;property === &#039;background&#039; &amp;&amp; $this-&gt;parser-&gt;get_cfg(&#039;optimise_shorthands&#039;) &gt; 2) {
-			$this-&gt;css[$this-&gt;at][$this-&gt;selector][&#039;background&#039;]=&#039;&#039;;
-			$this-&gt;parser-&gt;merge_css_blocks($this-&gt;at, $this-&gt;selector, csstidy_optimise::dissolve_short_bg($this-&gt;value));
-		}
-		if (isset($shorthands[$this-&gt;property])) {
-			$this-&gt;parser-&gt;merge_css_blocks($this-&gt;at, $this-&gt;selector, csstidy_optimise::dissolve_4value_shorthands($this-&gt;property, $this-&gt;value));
-			if (is_array($shorthands[$this-&gt;property])) {
-				$this-&gt;css[$this-&gt;at][$this-&gt;selector][$this-&gt;property] = &#039;&#039;;
-			}
-		}
-	}
-
-	/**
-	 * Optimises a sub-value
-	 * @access public
-	 * @version 1.0
-	 */
-	function subvalue() {
-		$replace_colors = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;replace_colors&#039;];
-
-		$this-&gt;sub_value = trim($this-&gt;sub_value);
-		if ($this-&gt;sub_value == &#039;&#039;) { // caution : &#039;0&#039;
-			return;
-		}
-
-		$important = &#039;&#039;;
-		if (csstidy::is_important($this-&gt;sub_value)) {
-			$important = &#039;!important&#039;;
-		}
-		$this-&gt;sub_value = csstidy::gvw_important($this-&gt;sub_value);
-
-		// Compress font-weight
-		if ($this-&gt;property === &#039;font-weight&#039; &amp;&amp; $this-&gt;parser-&gt;get_cfg(&#039;compress_font-weight&#039;)) {
-			if ($this-&gt;sub_value === &#039;bold&#039;) {
-				$this-&gt;sub_value = &#039;700&#039;;
-				$this-&gt;parser-&gt;log(&#039;Optimised font-weight: Changed &quot;bold&quot; to &quot;700&quot;&#039;, &#039;Information&#039;);
-			} else if ($this-&gt;sub_value === &#039;normal&#039;) {
-				$this-&gt;sub_value = &#039;400&#039;;
-				$this-&gt;parser-&gt;log(&#039;Optimised font-weight: Changed &quot;normal&quot; to &quot;400&quot;&#039;, &#039;Information&#039;);
-			}
-		}
-
-		$temp = $this-&gt;compress_numbers($this-&gt;sub_value);
-		if (strcasecmp($temp, $this-&gt;sub_value) !== 0) {
-			if (strlen($temp) &gt; strlen($this-&gt;sub_value)) {
-				$this-&gt;parser-&gt;log(&#039;Fixed invalid number: Changed &quot;&#039; . $this-&gt;sub_value . &#039;&quot; to &quot;&#039; . $temp . &#039;&quot;&#039;, &#039;Warning&#039;);
-			} else {
-				$this-&gt;parser-&gt;log(&#039;Optimised number: Changed &quot;&#039; . $this-&gt;sub_value . &#039;&quot; to &quot;&#039; . $temp . &#039;&quot;&#039;, &#039;Information&#039;);
-			}
-			$this-&gt;sub_value = $temp;
-		}
-		if ($this-&gt;parser-&gt;get_cfg(&#039;compress_colors&#039;)) {
-			$temp = $this-&gt;cut_color($this-&gt;sub_value);
-			if ($temp !== $this-&gt;sub_value) {
-				if (isset($replace_colors[$this-&gt;sub_value])) {
-					$this-&gt;parser-&gt;log(&#039;Fixed invalid color name: Changed &quot;&#039; . $this-&gt;sub_value . &#039;&quot; to &quot;&#039; . $temp . &#039;&quot;&#039;, &#039;Warning&#039;);
-				} else {
-					$this-&gt;parser-&gt;log(&#039;Optimised color: Changed &quot;&#039; . $this-&gt;sub_value . &#039;&quot; to &quot;&#039; . $temp . &#039;&quot;&#039;, &#039;Information&#039;);
-				}
-				$this-&gt;sub_value = $temp;
-			}
-		}
-		$this-&gt;sub_value .= $important;
-	}
-
-	/**
-	 * Compresses shorthand values. Example: margin:1px 1px 1px 1px -&gt; margin:1px
-	 * @param string $value
-	 * @access public
-	 * @return string
-	 * @version 1.0
-	 */
-	function shorthand($value) {
-		$important = &#039;&#039;;
-		if (csstidy::is_important($value)) {
-			$values = csstidy::gvw_important($value);
-			$important = &#039;!important&#039;;
-		}
-		else
-			$values = $value;
-
-		$values = explode(&#039; &#039;, $values);
-		switch (count($values)) {
-			case 4:
-				if ($values[0] == $values[1] &amp;&amp; $values[0] == $values[2] &amp;&amp; $values[0] == $values[3]) {
-					return $values[0] . $important;
-				} elseif ($values[1] == $values[3] &amp;&amp; $values[0] == $values[2]) {
-					return $values[0] . &#039; &#039; . $values[1] . $important;
-				} elseif ($values[1] == $values[3]) {
-					return $values[0] . &#039; &#039; . $values[1] . &#039; &#039; . $values[2] . $important;
-				}
-				break;
-
-			case 3:
-				if ($values[0] == $values[1] &amp;&amp; $values[0] == $values[2]) {
-					return $values[0] . $important;
-				} elseif ($values[0] == $values[2]) {
-					return $values[0] . &#039; &#039; . $values[1] . $important;
-				}
-				break;
-
-			case 2:
-				if ($values[0] == $values[1]) {
-					return $values[0] . $important;
-				}
-				break;
-		}
-
-		return $value;
-	}
-
-	/**
-	 * Removes unnecessary whitespace in ! important
-	 * @param string $string
-	 * @return string
-	 * @access public
-	 * @version 1.1
-	 */
-	function compress_important(&amp;$string) {
-		if (csstidy::is_important($string)) {
-			$string = csstidy::gvw_important($string) . &#039;!important&#039;;
-		}
-		return $string;
-	}
-
-	/**
-	 * Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.
-	 * @param string $color
-	 * @return string
-	 * @version 1.1
-	 */
-	function cut_color($color) {
-		$replace_colors = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;replace_colors&#039;];
-
-		// rgb(0,0,0) -&gt; #000000 (or #000 in this case later)
-		if (strtolower(substr($color, 0, 4)) === &#039;rgb(&#039;) {
-			$color_tmp = substr($color, 4, strlen($color) - 5);
-			$color_tmp = explode(&#039;,&#039;, $color_tmp);
-			for ($i = 0; $i &lt; count($color_tmp); $i++) {
-				$color_tmp[$i] = trim($color_tmp[$i]);
-				if (substr($color_tmp[$i], -1) === &#039;%&#039;) {
-					$color_tmp[$i] = round((255 * $color_tmp[$i]) / 100);
-				}
-				if ($color_tmp[$i] &gt; 255)
-					$color_tmp[$i] = 255;
-			}
-			$color = &#039;#&#039;;
-			for ($i = 0; $i &lt; 3; $i++) {
-				if ($color_tmp[$i] &lt; 16) {
-					$color .= &#039;0&#039; . dechex($color_tmp[$i]);
-				} else {
-					$color .= dechex($color_tmp[$i]);
-				}
-			}
-		}
-
-		// Fix bad color names
-		if (isset($replace_colors[strtolower($color)])) {
-			$color = $replace_colors[strtolower($color)];
-		}
-
-		// #aabbcc -&gt; #abc
-		if (strlen($color) == 7) {
-			$color_temp = strtolower($color);
-			if ($color_temp{0} === &#039;#&#039; &amp;&amp; $color_temp{1} == $color_temp{2} &amp;&amp; $color_temp{3} == $color_temp{4} &amp;&amp; $color_temp{5} == $color_temp{6}) {
-				$color = &#039;#&#039; . $color{1} . $color{3} . $color{5};
-			}
-		}
-
-		switch (strtolower($color)) {
-			/* color name -&gt; hex code */
-			case &#039;black&#039;: return &#039;#000&#039;;
-			case &#039;fuchsia&#039;: return &#039;#f0f&#039;;
-			case &#039;white&#039;: return &#039;#fff&#039;;
-			case &#039;yellow&#039;: return &#039;#ff0&#039;;
-
-			/* hex code -&gt; color name */
-			case &#039;#800000&#039;: return &#039;maroon&#039;;
-			case &#039;#ffa500&#039;: return &#039;orange&#039;;
-			case &#039;#808000&#039;: return &#039;olive&#039;;
-			case &#039;#800080&#039;: return &#039;purple&#039;;
-			case &#039;#008000&#039;: return &#039;green&#039;;
-			case &#039;#000080&#039;: return &#039;navy&#039;;
-			case &#039;#008080&#039;: return &#039;teal&#039;;
-			case &#039;#c0c0c0&#039;: return &#039;silver&#039;;
-			case &#039;#808080&#039;: return &#039;gray&#039;;
-			case &#039;#f00&#039;: return &#039;red&#039;;
-		}
-
-		return $color;
-	}
-
-	/**
-	 * Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )
-	 * @param string $subvalue
-	 * @return string
-	 * @version 1.2
-	 */
-	function compress_numbers($subvalue) {
-		$unit_values = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;unit_values&#039;];
-		$color_values = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;color_values&#039;];
-
-		// for font:1em/1em sans-serif...;
-		if ($this-&gt;property === &#039;font&#039;) {
-			$temp = explode(&#039;/&#039;, $subvalue);
-		} else {
-			$temp = array($subvalue);
-		}
-		for ($l = 0; $l &lt; count($temp); $l++) {
-			// if we are not dealing with a number at this point, do not optimise anything
-			$number = $this-&gt;AnalyseCssNumber($temp[$l]);
-			if ($number === false) {
-				return $subvalue;
-			}
-
-			// Fix bad colors
-			if (in_array($this-&gt;property, $color_values)) {
-				$temp[$l] = &#039;#&#039; . $temp[$l];
-				continue;
-			}
-
-			if (abs($number[0]) &gt; 0) {
-				if ($number[1] == &#039;&#039; &amp;&amp; in_array($this-&gt;property, $unit_values, true)) {
-					$number[1] = &#039;px&#039;;
-				}
-			} else {
-				$number[1] = &#039;&#039;;
-			}
-
-			$temp[$l] = $number[0] . $number[1];
-		}
-
-		return ((count($temp) &gt; 1) ? $temp[0] . &#039;/&#039; . $temp[1] : $temp[0]);
-	}
-
-	/**
-	 * Checks if a given string is a CSS valid number. If it is,
-	 * an array containing the value and unit is returned
-	 * @param string $string
-	 * @return array (&#039;unit&#039; if unit is found or &#039;&#039; if no unit exists, number value) or false if no number
-	 */
-	function AnalyseCssNumber($string) {
-		// most simple checks first
-		if (strlen($string) == 0 || ctype_alpha($string{0})) {
-			return false;
-		}
-
-		$units = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;units&#039;];
-		$return = array(0, &#039;&#039;);
-
-		$return[0] = floatval($string);
-		if (abs($return[0]) &gt; 0 &amp;&amp; abs($return[0]) &lt; 1) {
-			if ($return[0] &lt; 0) {
-				$return[0] = &#039;-&#039; . ltrim(substr($return[0], 1), &#039;0&#039;);
-			} else {
-				$return[0] = ltrim($return[0], &#039;0&#039;);
-			}
-		}
-
-		// Look for unit and split from value if exists
-		foreach ($units as $unit) {
-			$expectUnitAt = strlen($string) - strlen($unit);
-			if (!($unitInString = stristr($string, $unit))) { // mb_strpos() fails with &quot;false&quot;
-				continue;
-			}
-			$actualPosition = strpos($string, $unitInString);
-			if ($expectUnitAt === $actualPosition) {
-				$return[1] = $unit;
-				$string = substr($string, 0, - strlen($unit));
-				break;
-			}
-		}
-		if (!is_numeric($string)) {
-			return false;
-		}
-		return $return;
-	}
-
-	/**
-	 * Merges selectors with same properties. Example: a{color:red} b{color:red} -&gt; a,b{color:red}
-	 * Very basic and has at least one bug. Hopefully there is a replacement soon.
-	 * @param array $array
-	 * @return array
-	 * @access public
-	 * @version 1.2
-	 */
-	function merge_selectors(&amp;$array) {
-		$css = $array;
-		foreach ($css as $key =&gt; $value) {
-			if (!isset($css[$key])) {
-				continue;
-			}
-			$newsel = &#039;&#039;;
-
-			// Check if properties also exist in another selector
-			$keys = array();
-			// PHP bug (?) without $css = $array; here
-			foreach ($css as $selector =&gt; $vali) {
-				if ($selector == $key) {
-					continue;
-				}
-
-				if ($css[$key] === $vali) {
-					$keys[] = $selector;
-				}
-			}
-
-			if (!empty($keys)) {
-				$newsel = $key;
-				unset($css[$key]);
-				foreach ($keys as $selector) {
-					unset($css[$selector]);
-					$newsel .= &#039;,&#039; . $selector;
-				}
-				$css[$newsel] = $value;
-			}
-		}
-		$array = $css;
-	}
-
-	/**
-	 * Removes invalid selectors and their corresponding rule-sets as
-	 * defined by 4.1.7 in REC-CSS2. This is a very rudimentary check
-	 * and should be replaced by a full-blown parsing algorithm or
-	 * regular expression
-	 * @version 1.4
-	 */
-	function discard_invalid_selectors(&amp;$array) {
-		$invalid = array(&#039;+&#039; =&gt; true, &#039;~&#039; =&gt; true, &#039;,&#039; =&gt; true, &#039;&gt;&#039; =&gt; true);
-		foreach ($array as $selector =&gt; $decls) {
-			$ok = true;
-			$selectors = array_map(&#039;trim&#039;, explode(&#039;,&#039;, $selector));
-			foreach ($selectors as $s) {
-				$simple_selectors = preg_split(&#039;/\s*[+&gt;~\s]\s*/&#039;, $s);
-				foreach ($simple_selectors as $ss) {
-					if ($ss === &#039;&#039;)
-						$ok = false;
-					// could also check $ss for internal structure,
-					// but that probably would be too slow
-				}
-			}
-			if (!$ok)
-				unset($array[$selector]);
-		}
-	}
-
-	/**
-	 * Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...
-	 * @param string $property
-	 * @param string $value
-	 * @return array
-	 * @version 1.0
-	 * @see merge_4value_shorthands()
-	 */
-	function dissolve_4value_shorthands($property, $value) {
-		$shorthands = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;];
-		if (!is_array($shorthands[$property])) {
-			$return[$property] = $value;
-			return $return;
-		}
-
-		$important = &#039;&#039;;
-		if (csstidy::is_important($value)) {
-			$value = csstidy::gvw_important($value);
-			$important = &#039;!important&#039;;
-		}
-		$values = explode(&#039; &#039;, $value);
-
-
-		$return = array();
-		if (count($values) == 4) {
-			for ($i = 0; $i &lt; 4; $i++) {
-				$return[$shorthands[$property][$i]] = $values[$i] . $important;
-			}
-		} elseif (count($values) == 3) {
-			$return[$shorthands[$property][0]] = $values[0] . $important;
-			$return[$shorthands[$property][1]] = $values[1] . $important;
-			$return[$shorthands[$property][3]] = $values[1] . $important;
-			$return[$shorthands[$property][2]] = $values[2] . $important;
-		} elseif (count($values) == 2) {
-			for ($i = 0; $i &lt; 4; $i++) {
-				$return[$shorthands[$property][$i]] = (($i % 2 != 0)) ? $values[1] . $important : $values[0] . $important;
-			}
-		} else {
-			for ($i = 0; $i &lt; 4; $i++) {
-				$return[$shorthands[$property][$i]] = $values[0] . $important;
-			}
-		}
-
-		return $return;
-	}
-
-	/**
-	 * Explodes a string as explode() does, however, not if $sep is escaped or within a string.
-	 * @param string $sep seperator
-	 * @param string $string
-	 * @return array
-	 * @version 1.0
-	 */
-	function explode_ws($sep, $string) {
-		$status = &#039;st&#039;;
-		$to = &#039;&#039;;
-
-		$output = array();
-		$num = 0;
-		for ($i = 0, $len = strlen($string); $i &lt; $len; $i++) {
-			switch ($status) {
-				case &#039;st&#039;:
-					if ($string{$i} == $sep &amp;&amp; !csstidy::escaped($string, $i)) {
-						++$num;
-					} elseif ($string{$i} === &#039;&quot;&#039; || $string{$i} === &#039;\&#039;&#039; || $string{$i} === &#039;(&#039; &amp;&amp; !csstidy::escaped($string, $i)) {
-						$status = &#039;str&#039;;
-						$to = ($string{$i} === &#039;(&#039;) ? &#039;)&#039; : $string{$i};
-						(isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
-					} else {
-						(isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
-					}
-					break;
-
-				case &#039;str&#039;:
-					if ($string{$i} == $to &amp;&amp; !csstidy::escaped($string, $i)) {
-						$status = &#039;st&#039;;
-					}
-					(isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
-					break;
-			}
-		}
-
-		if (isset($output[0])) {
-			return $output;
-		} else {
-			return array($output);
-		}
-	}
-
-	/**
-	 * Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()
-	 * @param array $array
-	 * @return array
-	 * @version 1.2
-	 * @see dissolve_4value_shorthands()
-	 */
-	function merge_4value_shorthands($array) {
-		$return = $array;
-		$shorthands = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;];
-
-		foreach ($shorthands as $key =&gt; $value) {
-			if (isset($array[$value[0]]) &amp;&amp; isset($array[$value[1]])
-							&amp;&amp; isset($array[$value[2]]) &amp;&amp; isset($array[$value[3]]) &amp;&amp; $value !== 0) {
-				$return[$key] = &#039;&#039;;
-
-				$important = &#039;&#039;;
-				for ($i = 0; $i &lt; 4; $i++) {
-					$val = $array[$value[$i]];
-					if (csstidy::is_important($val)) {
-						$important = &#039;!important&#039;;
-						$return[$key] .= csstidy::gvw_important($val) . &#039; &#039;;
-					} else {
-						$return[$key] .= $val . &#039; &#039;;
-					}
-					unset($return[$value[$i]]);
-				}
-				$return[$key] = csstidy_optimise::shorthand(trim($return[$key] . $important));
-			}
-		}
-		return $return;
-	}
-
-	/**
-	 * Dissolve background property
-	 * @param string $str_value
-	 * @return array
-	 * @version 1.0
-	 * @see merge_bg()
-	 * @todo full CSS 3 compliance
-	 */
-	function dissolve_short_bg($str_value) {
-		// don&#039;t try to explose background gradient !
-		if (stripos($str_value, &quot;gradient(&quot;)!==FALSE)
-			return array(&#039;background&#039;=&gt;$str_value);
-		
-		$background_prop_default = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;background_prop_default&#039;];
-		$repeat = array(&#039;repeat&#039;, &#039;repeat-x&#039;, &#039;repeat-y&#039;, &#039;no-repeat&#039;, &#039;space&#039;);
-		$attachment = array(&#039;scroll&#039;, &#039;fixed&#039;, &#039;local&#039;);
-		$clip = array(&#039;border&#039;, &#039;padding&#039;);
-		$origin = array(&#039;border&#039;, &#039;padding&#039;, &#039;content&#039;);
-		$pos = array(&#039;top&#039;, &#039;center&#039;, &#039;bottom&#039;, &#039;left&#039;, &#039;right&#039;);
-		$important = &#039;&#039;;
-		$return = array(&#039;background-image&#039; =&gt; null, &#039;background-size&#039; =&gt; null, &#039;background-repeat&#039; =&gt; null, &#039;background-position&#039; =&gt; null, &#039;background-attachment&#039; =&gt; null, &#039;background-clip&#039; =&gt; null, &#039;background-origin&#039; =&gt; null, &#039;background-color&#039; =&gt; null);
-
-		if (csstidy::is_important($str_value)) {
-			$important = &#039; !important&#039;;
-			$str_value = csstidy::gvw_important($str_value);
-		}
-
-		$str_value = csstidy_optimise::explode_ws(&#039;,&#039;, $str_value);
-		for ($i = 0; $i &lt; count($str_value); $i++) {
-			$have[&#039;clip&#039;] = false;
-			$have[&#039;pos&#039;] = false;
-			$have[&#039;color&#039;] = false;
-			$have[&#039;bg&#039;] = false;
-
-			if (is_array($str_value[$i])) {
-				$str_value[$i] = $str_value[$i][0];
-			}
-			$str_value[$i] = csstidy_optimise::explode_ws(&#039; &#039;, trim($str_value[$i]));
-
-			for ($j = 0; $j &lt; count($str_value[$i]); $j++) {
-				if ($have[&#039;bg&#039;] === false &amp;&amp; (substr($str_value[$i][$j], 0, 4) === &#039;url(&#039; || $str_value[$i][$j] === &#039;none&#039;)) {
-					$return[&#039;background-image&#039;] .= $str_value[$i][$j] . &#039;,&#039;;
-					$have[&#039;bg&#039;] = true;
-				} elseif (in_array($str_value[$i][$j], $repeat, true)) {
-					$return[&#039;background-repeat&#039;] .= $str_value[$i][$j] . &#039;,&#039;;
-				} elseif (in_array($str_value[$i][$j], $attachment, true)) {
-					$return[&#039;background-attachment&#039;] .= $str_value[$i][$j] . &#039;,&#039;;
-				} elseif (in_array($str_value[$i][$j], $clip, true) &amp;&amp; !$have[&#039;clip&#039;]) {
-					$return[&#039;background-clip&#039;] .= $str_value[$i][$j] . &#039;,&#039;;
-					$have[&#039;clip&#039;] = true;
-				} elseif (in_array($str_value[$i][$j], $origin, true)) {
-					$return[&#039;background-origin&#039;] .= $str_value[$i][$j] . &#039;,&#039;;
-				} elseif ($str_value[$i][$j]{0} === &#039;(&#039;) {
-					$return[&#039;background-size&#039;] .= substr($str_value[$i][$j], 1, -1) . &#039;,&#039;;
-				} elseif (in_array($str_value[$i][$j], $pos, true) || is_numeric($str_value[$i][$j]{0}) || $str_value[$i][$j]{0} === null || $str_value[$i][$j]{0} === &#039;-&#039; || $str_value[$i][$j]{0} === &#039;.&#039;) {
-					$return[&#039;background-position&#039;] .= $str_value[$i][$j];
-					if (!$have[&#039;pos&#039;])
-						$return[&#039;background-position&#039;] .= &#039; &#039;; else
-						$return[&#039;background-position&#039;].= &#039;,&#039;;
-					$have[&#039;pos&#039;] = true;
-				}
-				elseif (!$have[&#039;color&#039;]) {
-					$return[&#039;background-color&#039;] .= $str_value[$i][$j] . &#039;,&#039;;
-					$have[&#039;color&#039;] = true;
-				}
-			}
-		}
-
-		foreach ($background_prop_default as $bg_prop =&gt; $default_value) {
-			if ($return[$bg_prop] !== null) {
-				$return[$bg_prop] = substr($return[$bg_prop], 0, -1) . $important;
-			}
-			else
-				$return[$bg_prop] = $default_value . $important;
-		}
-		return $return;
-	}
-
-	/**
-	 * Merges all background properties
-	 * @param array $input_css
-	 * @return array
-	 * @version 1.0
-	 * @see dissolve_short_bg()
-	 * @todo full CSS 3 compliance
-	 */
-	function merge_bg($input_css) {
-		$background_prop_default = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;background_prop_default&#039;];
-		// Max number of background images. CSS3 not yet fully implemented
-		$number_of_values = @max(count(csstidy_optimise::explode_ws(&#039;,&#039;, $input_css[&#039;background-image&#039;])), count(csstidy_optimise::explode_ws(&#039;,&#039;, $input_css[&#039;background-color&#039;])), 1);
-		// Array with background images to check if BG image exists
-		$bg_img_array = @csstidy_optimise::explode_ws(&#039;,&#039;, csstidy::gvw_important($input_css[&#039;background-image&#039;]));
-		$new_bg_value = &#039;&#039;;
-		$important = &#039;&#039;;
-
-		// if background properties is here and not empty, don&#039;t try anything
-		if (isset($input_css[&#039;background&#039;]) AND $input_css[&#039;background&#039;])
-			return $input_css;
-		
-		for ($i = 0; $i &lt; $number_of_values; $i++) {
-			foreach ($background_prop_default as $bg_property =&gt; $default_value) {
-				// Skip if property does not exist
-				if (!isset($input_css[$bg_property])) {
-					continue;
-				}
-
-				$cur_value = $input_css[$bg_property];
-				// skip all optimisation if gradient() somewhere
-				if (stripos($cur_value, &quot;gradient(&quot;)!==FALSE)
-					return $input_css;
-
-				// Skip some properties if there is no background image
-				if ((!isset($bg_img_array[$i]) || $bg_img_array[$i] === &#039;none&#039;)
-								&amp;&amp; ($bg_property === &#039;background-size&#039; || $bg_property === &#039;background-position&#039;
+  /**
+   * Constructor
+   * @param array $css contains the class csstidy
+   * @access private
+   * @version 1.0
+   */
+  function csstidy_optimise(&amp;$css) {
+    $this-&gt;parser = &amp; $css;
+    $this-&gt;css = &amp; $css-&gt;css;
+    $this-&gt;sub_value = &amp; $css-&gt;sub_value;
+    $this-&gt;at = &amp; $css-&gt;at;
+    $this-&gt;selector = &amp; $css-&gt;selector;
+    $this-&gt;property = &amp; $css-&gt;property;
+    $this-&gt;value = &amp; $css-&gt;value;
+  }
+
+  /**
+   * Optimises $css after parsing
+   * @access public
+   * @version 1.0
+   */
+  function postparse() {
+    if ($this-&gt;parser-&gt;get_cfg(&#039;preserve_css&#039;)) {
+      return;
+    }
+
+    if ($this-&gt;parser-&gt;get_cfg(&#039;merge_selectors&#039;) === 2) {
+      foreach ($this-&gt;css as $medium =&gt; $value) {
+        $this-&gt;merge_selectors($this-&gt;css[$medium]);
+      }
+    }
+
+    if ($this-&gt;parser-&gt;get_cfg(&#039;discard_invalid_selectors&#039;)) {
+      foreach ($this-&gt;css as $medium =&gt; $value) {
+        $this-&gt;discard_invalid_selectors($this-&gt;css[$medium]);
+      }
+    }
+
+    if ($this-&gt;parser-&gt;get_cfg(&#039;optimise_shorthands&#039;) &gt; 0) {
+      foreach ($this-&gt;css as $medium =&gt; $value) {
+        foreach ($value as $selector =&gt; $value1) {
+          $this-&gt;css[$medium][$selector] = csstidy_optimise::merge_4value_shorthands($this-&gt;css[$medium][$selector]);
+
+          if ($this-&gt;parser-&gt;get_cfg(&#039;optimise_shorthands&#039;) &lt; 2) {
+            continue;
+          }
+
+          $this-&gt;css[$medium][$selector] = csstidy_optimise::merge_font($this-&gt;css[$medium][$selector]);
+
+          if ($this-&gt;parser-&gt;get_cfg(&#039;optimise_shorthands&#039;) &lt; 3) {
+            continue;
+          }
+
+          $this-&gt;css[$medium][$selector] = csstidy_optimise::merge_bg($this-&gt;css[$medium][$selector]);
+          if (empty($this-&gt;css[$medium][$selector])) {
+            unset($this-&gt;css[$medium][$selector]);
+          }
+        }
+      }
+    }
+  }
+
+  /**
+   * Optimises values
+   * @access public
+   * @version 1.0
+   */
+  function value() {
+    $shorthands = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;];
+
+    // optimise shorthand properties
+    if (isset($shorthands[$this-&gt;property])) {
+      $temp = csstidy_optimise::shorthand($this-&gt;value); // FIXME - move
+      if ($temp != $this-&gt;value) {
+        $this-&gt;parser-&gt;log(&#039;Optimised shorthand notation (&#039; . $this-&gt;property . &#039;): Changed &quot;&#039; . $this-&gt;value . &#039;&quot; to &quot;&#039; . $temp . &#039;&quot;&#039;, &#039;Information&#039;);
+      }
+      $this-&gt;value = $temp;
+    }
+
+    // Remove whitespace at ! important
+    if ($this-&gt;value != $this-&gt;compress_important($this-&gt;value)) {
+      $this-&gt;parser-&gt;log(&#039;Optimised !important&#039;, &#039;Information&#039;);
+    }
+  }
+
+  /**
+   * Optimises shorthands
+   * @access public
+   * @version 1.0
+   */
+  function shorthands() {
+    $shorthands = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;];
+
+    if (!$this-&gt;parser-&gt;get_cfg(&#039;optimise_shorthands&#039;) || $this-&gt;parser-&gt;get_cfg(&#039;preserve_css&#039;)) {
+      return;
+    }
+
+    if ($this-&gt;property === &#039;font&#039; &amp;&amp; $this-&gt;parser-&gt;get_cfg(&#039;optimise_shorthands&#039;) &gt; 1) {
+      $this-&gt;css[$this-&gt;at][$this-&gt;selector][&#039;font&#039;] = &#039;&#039;;
+      $this-&gt;parser-&gt;merge_css_blocks($this-&gt;at, $this-&gt;selector, csstidy_optimise::dissolve_short_font($this-&gt;value));
+    }
+    if ($this-&gt;property === &#039;background&#039; &amp;&amp; $this-&gt;parser-&gt;get_cfg(&#039;optimise_shorthands&#039;) &gt; 2) {
+      $this-&gt;css[$this-&gt;at][$this-&gt;selector][&#039;background&#039;] = &#039;&#039;;
+      $this-&gt;parser-&gt;merge_css_blocks($this-&gt;at, $this-&gt;selector, csstidy_optimise::dissolve_short_bg($this-&gt;value));
+    }
+    if (isset($shorthands[$this-&gt;property])) {
+      $this-&gt;parser-&gt;merge_css_blocks($this-&gt;at, $this-&gt;selector, csstidy_optimise::dissolve_4value_shorthands($this-&gt;property, $this-&gt;value));
+      if (is_array($shorthands[$this-&gt;property])) {
+        $this-&gt;css[$this-&gt;at][$this-&gt;selector][$this-&gt;property] = &#039;&#039;;
+      }
+    }
+  }
+
+  /**
+   * Optimises a sub-value
+   * @access public
+   * @version 1.0
+   */
+  function subvalue() {
+    $replace_colors = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;replace_colors&#039;];
+
+    $this-&gt;sub_value = trim($this-&gt;sub_value);
+    if ($this-&gt;sub_value == &#039;&#039;) { // caution : &#039;0&#039;
+      return;
+    }
+
+    $important = &#039;&#039;;
+    if (csstidy::is_important($this-&gt;sub_value)) {
+      $important = &#039;!important&#039;;
+    }
+    $this-&gt;sub_value = csstidy::gvw_important($this-&gt;sub_value);
+
+    // Compress font-weight
+    if ($this-&gt;property === &#039;font-weight&#039; &amp;&amp; $this-&gt;parser-&gt;get_cfg(&#039;compress_font-weight&#039;)) {
+      if ($this-&gt;sub_value === &#039;bold&#039;) {
+        $this-&gt;sub_value = &#039;700&#039;;
+        $this-&gt;parser-&gt;log(&#039;Optimised font-weight: Changed &quot;bold&quot; to &quot;700&quot;&#039;, &#039;Information&#039;);
+      }
+      else if ($this-&gt;sub_value === &#039;normal&#039;) {
+        $this-&gt;sub_value = &#039;400&#039;;
+        $this-&gt;parser-&gt;log(&#039;Optimised font-weight: Changed &quot;normal&quot; to &quot;400&quot;&#039;, &#039;Information&#039;);
+      }
+    }
+
+    $temp = $this-&gt;compress_numbers($this-&gt;sub_value);
+    if (strcasecmp($temp, $this-&gt;sub_value) !== 0) {
+      if (strlen($temp) &gt; strlen($this-&gt;sub_value)) {
+        $this-&gt;parser-&gt;log(&#039;Fixed invalid number: Changed &quot;&#039; . $this-&gt;sub_value . &#039;&quot; to &quot;&#039; . $temp . &#039;&quot;&#039;, &#039;Warning&#039;);
+      }
+      else {
+        $this-&gt;parser-&gt;log(&#039;Optimised number: Changed &quot;&#039; . $this-&gt;sub_value . &#039;&quot; to &quot;&#039; . $temp . &#039;&quot;&#039;, &#039;Information&#039;);
+      }
+      $this-&gt;sub_value = $temp;
+    }
+    if ($this-&gt;parser-&gt;get_cfg(&#039;compress_colors&#039;)) {
+      $temp = $this-&gt;cut_color($this-&gt;sub_value);
+      if ($temp !== $this-&gt;sub_value) {
+        if (isset($replace_colors[$this-&gt;sub_value])) {
+          $this-&gt;parser-&gt;log(&#039;Fixed invalid color name: Changed &quot;&#039; . $this-&gt;sub_value . &#039;&quot; to &quot;&#039; . $temp . &#039;&quot;&#039;, &#039;Warning&#039;);
+        }
+        else {
+          $this-&gt;parser-&gt;log(&#039;Optimised color: Changed &quot;&#039; . $this-&gt;sub_value . &#039;&quot; to &quot;&#039; . $temp . &#039;&quot;&#039;, &#039;Information&#039;);
+        }
+        $this-&gt;sub_value = $temp;
+      }
+    }
+    $this-&gt;sub_value .= $important;
+  }
+
+  /**
+   * Compresses shorthand values. Example: margin:1px 1px 1px 1px -&gt; margin:1px
+   * @param string $value
+   * @access public
+   * @return string
+   * @version 1.0
+   */
+  function shorthand($value) {
+    $important = &#039;&#039;;
+    if (csstidy::is_important($value)) {
+      $values = csstidy::gvw_important($value);
+      $important = &#039;!important&#039;;
+    }
+    else {
+      $values = $value;
+    }
+
+    $values = explode(&#039; &#039;, $values);
+    switch (count($values)) {
+      case 4:
+        if ($values[0] == $values[1] &amp;&amp; $values[0] == $values[2] &amp;&amp; $values[0] == $values[3]) {
+          return $values[0] . $important;
+        }
+        elseif ($values[1] == $values[3] &amp;&amp; $values[0] == $values[2]) {
+          return $values[0] . &#039; &#039; . $values[1] . $important;
+        }
+        elseif ($values[1] == $values[3]) {
+          return $values[0] . &#039; &#039; . $values[1] . &#039; &#039; . $values[2] . $important;
+        }
+        break;
+
+      case 3:
+        if ($values[0] == $values[1] &amp;&amp; $values[0] == $values[2]) {
+          return $values[0] . $important;
+        }
+        elseif ($values[0] == $values[2]) {
+          return $values[0] . &#039; &#039; . $values[1] . $important;
+        }
+        break;
+
+      case 2:
+        if ($values[0] == $values[1]) {
+          return $values[0] . $important;
+        }
+        break;
+    }
+
+    return $value;
+  }
+
+  /**
+   * Removes unnecessary whitespace in ! important
+   * @param string $string
+   * @return string
+   * @access public
+   * @version 1.1
+   */
+  function compress_important(&amp;$string) {
+    if (csstidy::is_important($string)) {
+      $string = csstidy::gvw_important($string) . &#039;!important&#039;;
+    }
+    return $string;
+  }
+
+  /**
+   * Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values.
+   * @param string $color
+   * @return string
+   * @version 1.1
+   */
+  function cut_color($color) {
+    $replace_colors = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;replace_colors&#039;];
+
+    // rgb(0,0,0) -&gt; #000000 (or #000 in this case later)
+    if (strtolower(substr($color, 0, 4)) === &#039;rgb(&#039;) {
+      $color_tmp = substr($color, 4, strlen($color) - 5);
+      $color_tmp = explode(&#039;,&#039;, $color_tmp);
+      for ($i = 0; $i &lt; count($color_tmp); $i++) {
+        $color_tmp[$i] = trim($color_tmp[$i]);
+        if (substr($color_tmp[$i], -1) === &#039;%&#039;) {
+          $color_tmp[$i] = round((255 * $color_tmp[$i]) / 100);
+        }
+        if ($color_tmp[$i] &gt; 255) {
+          $color_tmp[$i] = 255;
+        }
+      }
+      $color = &#039;#&#039;;
+      for ($i = 0; $i &lt; 3; $i++) {
+        if ($color_tmp[$i] &lt; 16) {
+          $color .= &#039;0&#039; . dechex($color_tmp[$i]);
+        }
+        else {
+          $color .= dechex($color_tmp[$i]);
+        }
+      }
+    }
+
+    // Fix bad color names
+    if (isset($replace_colors[strtolower($color)])) {
+      $color = $replace_colors[strtolower($color)];
+    }
+
+    // #aabbcc -&gt; #abc
+    if (strlen($color) == 7) {
+      $color_temp = strtolower($color);
+      if ($color_temp{0} === &#039;#&#039; &amp;&amp; $color_temp{1} == $color_temp{2} &amp;&amp; $color_temp{3} == $color_temp{4} &amp;&amp; $color_temp{5} == $color_temp{6}) {
+        $color = &#039;#&#039; . $color{1} . $color{3} . $color{5};
+      }
+    }
+
+    switch (strtolower($color)) {
+      /* color name -&gt; hex code */
+      case &#039;black&#039;:
+        return &#039;#000&#039;;
+      case &#039;fuchsia&#039;:
+        return &#039;#f0f&#039;;
+      case &#039;white&#039;:
+        return &#039;#fff&#039;;
+      case &#039;yellow&#039;:
+        return &#039;#ff0&#039;;
+
+        /* hex code -&gt; color name */
+      case &#039;#800000&#039;:
+        return &#039;maroon&#039;;
+      case &#039;#ffa500&#039;:
+        return &#039;orange&#039;;
+      case &#039;#808000&#039;:
+        return &#039;olive&#039;;
+      case &#039;#800080&#039;:
+        return &#039;purple&#039;;
+      case &#039;#008000&#039;:
+        return &#039;green&#039;;
+      case &#039;#000080&#039;:
+        return &#039;navy&#039;;
+      case &#039;#008080&#039;:
+        return &#039;teal&#039;;
+      case &#039;#c0c0c0&#039;:
+        return &#039;silver&#039;;
+      case &#039;#808080&#039;:
+        return &#039;gray&#039;;
+      case &#039;#f00&#039;:
+        return &#039;red&#039;;
+    }
+
+    return $color;
+  }
+
+  /**
+   * Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 )
+   * @param string $subvalue
+   * @return string
+   * @version 1.2
+   */
+  function compress_numbers($subvalue) {
+    $unit_values = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;unit_values&#039;];
+    $color_values = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;color_values&#039;];
+
+    // for font:1em/1em sans-serif...;
+    if ($this-&gt;property === &#039;font&#039;) {
+      $temp = explode(&#039;/&#039;, $subvalue);
+    }
+    else {
+      $temp = array($subvalue);
+    }
+    for ($l = 0; $l &lt; count($temp); $l++) {
+      // if we are not dealing with a number at this point, do not optimise anything
+      $number = $this-&gt;AnalyseCssNumber($temp[$l]);
+      if ($number === false) {
+        return $subvalue;
+      }
+
+      // Fix bad colors
+      if (in_array($this-&gt;property, $color_values)) {
+        $temp[$l] = &#039;#&#039; . $temp[$l];
+        continue;
+      }
+
+      if (abs($number[0]) &gt; 0) {
+        if ($number[1] == &#039;&#039; &amp;&amp; in_array($this-&gt;property, $unit_values, true)) {
+          $number[1] = &#039;px&#039;;
+        }
+      }
+      else {
+        $number[1] = &#039;&#039;;
+      }
+
+      $temp[$l] = $number[0] . $number[1];
+    }
+
+    return ((count($temp) &gt; 1) ? $temp[0] . &#039;/&#039; . $temp[1] : $temp[0]);
+  }
+
+  /**
+   * Checks if a given string is a CSS valid number. If it is,
+   * an array containing the value and unit is returned
+   * @param string $string
+   * @return array (&#039;unit&#039; if unit is found or &#039;&#039; if no unit exists, number value) or false if no number
+   */
+  function AnalyseCssNumber($string) {
+    // most simple checks first
+    if (strlen($string) == 0 || ctype_alpha($string{0})) {
+      return false;
+    }
+
+    $units = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;units&#039;];
+    $return = array(0, &#039;&#039;);
+
+    $return[0] = floatval($string);
+    if (abs($return[0]) &gt; 0 &amp;&amp; abs($return[0]) &lt; 1) {
+      if ($return[0] &lt; 0) {
+        $return[0] = &#039;-&#039; . ltrim(substr($return[0], 1), &#039;0&#039;);
+      }
+      else {
+        $return[0] = ltrim($return[0], &#039;0&#039;);
+      }
+    }
+
+    // Look for unit and split from value if exists
+    foreach ($units as $unit) {
+      $expectUnitAt = strlen($string) - strlen($unit);
+      if (!($unitInString = stristr($string, $unit))) { // mb_strpos() fails with &quot;false&quot;
+        continue;
+      }
+      $actualPosition = strpos($string, $unitInString);
+      if ($expectUnitAt === $actualPosition) {
+        $return[1] = $unit;
+        $string = substr($string, 0, - strlen($unit));
+        break;
+      }
+    }
+    if (!is_numeric($string)) {
+      return false;
+    }
+    return $return;
+  }
+
+  /**
+   * Merges selectors with same properties. Example: a{color:red} b{color:red} -&gt; a,b{color:red}
+   * Very basic and has at least one bug. Hopefully there is a replacement soon.
+   * @param array $array
+   * @return array
+   * @access public
+   * @version 1.2
+   */
+  function merge_selectors(&amp;$array) {
+    $css = $array;
+    foreach ($css as $key =&gt; $value) {
+      if (!isset($css[$key])) {
+        continue;
+      }
+      $newsel = &#039;&#039;;
+
+      // Check if properties also exist in another selector
+      $keys = array();
+      // PHP bug (?) without $css = $array; here
+      foreach ($css as $selector =&gt; $vali) {
+        if ($selector == $key) {
+          continue;
+        }
+
+        if ($css[$key] === $vali) {
+          $keys[] = $selector;
+        }
+      }
+
+      if (!empty($keys)) {
+        $newsel = $key;
+        unset($css[$key]);
+        foreach ($keys as $selector) {
+          unset($css[$selector]);
+          $newsel .= &#039;,&#039; . $selector;
+        }
+        $css[$newsel] = $value;
+      }
+    }
+    $array = $css;
+  }
+
+  /**
+   * Removes invalid selectors and their corresponding rule-sets as
+   * defined by 4.1.7 in REC-CSS2. This is a very rudimentary check
+   * and should be replaced by a full-blown parsing algorithm or
+   * regular expression
+   * @version 1.4
+   */
+  function discard_invalid_selectors(&amp;$array) {
+    $invalid = array(
+      &#039;+&#039; =&gt; true,
+      &#039;~&#039; =&gt; true,
+      &#039;,&#039; =&gt; true,
+      &#039;&gt;&#039; =&gt; true,
+    );
+    foreach ($array as $selector =&gt; $decls) {
+      $ok = true;
+      $selectors = array_map(&#039;trim&#039;, explode(&#039;,&#039;, $selector));
+      foreach ($selectors as $s) {
+        $simple_selectors = preg_split(&#039;/\s*[+&gt;~\s]\s*/&#039;, $s);
+        foreach ($simple_selectors as $ss) {
+          if ($ss === &#039;&#039;) {
+            $ok = false;
+          }
+          // could also check $ss for internal structure,
+          // but that probably would be too slow
+        }
+      }
+      if (!$ok) {
+        unset($array[$selector]);
+      }
+    }
+  }
+
+  /**
+   * Dissolves properties like padding:10px 10px 10px to padding-top:10px;padding-bottom:10px;...
+   * @param string $property
+   * @param string $value
+   * @return array
+   * @version 1.0
+   * @see merge_4value_shorthands()
+   */
+  function dissolve_4value_shorthands($property, $value) {
+    $shorthands = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;];
+    if (!is_array($shorthands[$property])) {
+      $return[$property] = $value;
+      return $return;
+    }
+
+    $important = &#039;&#039;;
+    if (csstidy::is_important($value)) {
+      $value = csstidy::gvw_important($value);
+      $important = &#039;!important&#039;;
+    }
+    $values = explode(&#039; &#039;, $value);
+
+
+    $return = array();
+    if (count($values) == 4) {
+      for ($i = 0; $i &lt; 4; $i++) {
+        $return[$shorthands[$property][$i]] = $values[$i] . $important;
+      }
+    }
+    elseif (count($values) == 3) {
+      $return[$shorthands[$property][0]] = $values[0] . $important;
+      $return[$shorthands[$property][1]] = $values[1] . $important;
+      $return[$shorthands[$property][3]] = $values[1] . $important;
+      $return[$shorthands[$property][2]] = $values[2] . $important;
+    }
+    elseif (count($values) == 2) {
+      for ($i = 0; $i &lt; 4; $i++) {
+        $return[$shorthands[$property][$i]] = (($i % 2 != 0)) ? $values[1] . $important : $values[0] . $important;
+      }
+    }
+    else {
+      for ($i = 0; $i &lt; 4; $i++) {
+        $return[$shorthands[$property][$i]] = $values[0] . $important;
+      }
+    }
+
+    return $return;
+  }
+
+  /**
+   * Explodes a string as explode() does, however, not if $sep is escaped or within a string.
+   * @param string $sep seperator
+   * @param string $string
+   * @return array
+   * @version 1.0
+   */
+  function explode_ws($sep, $string) {
+    $status = &#039;st&#039;;
+    $to = &#039;&#039;;
+
+    $output = array();
+    $num = 0;
+    for ($i = 0, $len = strlen($string); $i &lt; $len; $i++) {
+      switch ($status) {
+        case &#039;st&#039;:
+          if ($string{$i} == $sep &amp;&amp; !csstidy::escaped($string, $i)) {
+            ++$num;
+          }
+          elseif ($string{$i} === &#039;&quot;&#039; || $string{$i} === &#039;\&#039;&#039; || $string{$i} === &#039;(&#039; &amp;&amp; !csstidy::escaped($string, $i)) {
+            $status = &#039;str&#039;;
+            $to = ($string{$i} === &#039;(&#039;) ? &#039;)&#039; : $string{$i};
+            (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
+          }
+          else {
+            (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
+          }
+          break;
+
+        case &#039;str&#039;:
+          if ($string{$i} == $to &amp;&amp; !csstidy::escaped($string, $i)) {
+            $status = &#039;st&#039;;
+          }
+          (isset($output[$num])) ? $output[$num] .= $string{$i} : $output[$num] = $string{$i};
+          break;
+      }
+    }
+
+    if (isset($output[0])) {
+      return $output;
+    }
+    else {
+      return array($output);
+    }
+  }
+
+  /**
+   * Merges Shorthand properties again, the opposite of dissolve_4value_shorthands()
+   * @param array $array
+   * @return array
+   * @version 1.2
+   * @see dissolve_4value_shorthands()
+   */
+  function merge_4value_shorthands($array) {
+    $return = $array;
+    $shorthands = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;];
+
+    foreach ($shorthands as $key =&gt; $value) {
+      if (isset($array[$value[0]]) &amp;&amp; isset($array[$value[1]])
+							 &amp;&amp; isset($array[$value[2]]) &amp;&amp; isset($array[$value[3]]) &amp;&amp; $value !== 0) {
+        $return[$key] = &#039;&#039;;
+
+        $important = &#039;&#039;;
+        for ($i = 0; $i &lt; 4; $i++) {
+          $val = $array[$value[$i]];
+          if (csstidy::is_important($val)) {
+            $important = &#039;!important&#039;;
+            $return[$key] .= csstidy::gvw_important($val) . &#039; &#039;;
+          }
+          else {
+            $return[$key] .= $val . &#039; &#039;;
+          }
+          unset($return[$value[$i]]);
+        }
+        $return[$key] = csstidy_optimise::shorthand(trim($return[$key] . $important));
+      }
+    }
+    return $return;
+  }
+
+  /**
+   * Dissolve background property
+   * @param string $str_value
+   * @return array
+   * @version 1.0
+   * @see merge_bg()
+   * @todo full CSS 3 compliance
+   */
+  function dissolve_short_bg($str_value) {
+    // don&#039;t try to explose background gradient !
+    if (stripos($str_value, &quot;gradient(&quot;) !== FALSE) {
+      return array(&#039;background&#039; =&gt; $str_value);
+    }
+
+    $background_prop_default = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;background_prop_default&#039;];
+    $repeat = array(&#039;repeat&#039;, &#039;repeat-x&#039;, &#039;repeat-y&#039;, &#039;no-repeat&#039;, &#039;space&#039;);
+    $attachment = array(&#039;scroll&#039;, &#039;fixed&#039;, &#039;local&#039;);
+    $clip = array(&#039;border&#039;, &#039;padding&#039;);
+    $origin = array(&#039;border&#039;, &#039;padding&#039;, &#039;content&#039;);
+    $pos = array(&#039;top&#039;, &#039;center&#039;, &#039;bottom&#039;, &#039;left&#039;, &#039;right&#039;);
+    $important = &#039;&#039;;
+    $return = array(
+      &#039;background-image&#039; =&gt; null,
+      &#039;background-size&#039; =&gt; null,
+      &#039;background-repeat&#039; =&gt; null,
+      &#039;background-position&#039; =&gt; null,
+      &#039;background-attachment&#039; =&gt; null,
+      &#039;background-clip&#039; =&gt; null,
+      &#039;background-origin&#039; =&gt; null,
+      &#039;background-color&#039; =&gt; null,
+    );
+
+    if (csstidy::is_important($str_value)) {
+      $important = &#039; !important&#039;;
+      $str_value = csstidy::gvw_important($str_value);
+    }
+
+    $str_value = csstidy_optimise::explode_ws(&#039;,&#039;, $str_value);
+    for ($i = 0; $i &lt; count($str_value); $i++) {
+      $have[&#039;clip&#039;] = false;
+      $have[&#039;pos&#039;] = false;
+      $have[&#039;color&#039;] = false;
+      $have[&#039;bg&#039;] = false;
+
+      if (is_array($str_value[$i])) {
+        $str_value[$i] = $str_value[$i][0];
+      }
+      $str_value[$i] = csstidy_optimise::explode_ws(&#039; &#039;, trim($str_value[$i]));
+
+      for ($j = 0; $j &lt; count($str_value[$i]); $j++) {
+        if ($have[&#039;bg&#039;] === false &amp;&amp; (substr($str_value[$i][$j], 0, 4) === &#039;url(&#039; || $str_value[$i][$j] === &#039;none&#039;)) {
+          $return[&#039;background-image&#039;] .= $str_value[$i][$j] . &#039;,&#039;;
+          $have[&#039;bg&#039;] = true;
+        }
+        elseif (in_array($str_value[$i][$j], $repeat, true)) {
+          $return[&#039;background-repeat&#039;] .= $str_value[$i][$j] . &#039;,&#039;;
+        }
+        elseif (in_array($str_value[$i][$j], $attachment, true)) {
+          $return[&#039;background-attachment&#039;] .= $str_value[$i][$j] . &#039;,&#039;;
+        }
+        elseif (in_array($str_value[$i][$j], $clip, true) &amp;&amp; !$have[&#039;clip&#039;]) {
+          $return[&#039;background-clip&#039;] .= $str_value[$i][$j] . &#039;,&#039;;
+          $have[&#039;clip&#039;] = true;
+        }
+        elseif (in_array($str_value[$i][$j], $origin, true)) {
+          $return[&#039;background-origin&#039;] .= $str_value[$i][$j] . &#039;,&#039;;
+        }
+        elseif ($str_value[$i][$j]{0} === &#039;(&#039;) {
+          $return[&#039;background-size&#039;] .= substr($str_value[$i][$j], 1, -1) . &#039;,&#039;;
+        }
+        elseif (in_array($str_value[$i][$j], $pos, true) || is_numeric($str_value[$i][$j]{0}) || $str_value[$i][$j]{0} === null || $str_value[$i][$j]{0} === &#039;-&#039; || $str_value[$i][$j]{0} === &#039;.&#039;) {
+          $return[&#039;background-position&#039;] .= $str_value[$i][$j];
+          if (!$have[&#039;pos&#039;]) {
+            $return[&#039;background-position&#039;] .= &#039; &#039;;
+          }
+          else {
+            $return[&#039;background-position&#039;] .= &#039;,&#039;;
+          }
+          $have[&#039;pos&#039;] = true;
+        }
+        elseif (!$have[&#039;color&#039;]) {
+          $return[&#039;background-color&#039;] .= $str_value[$i][$j] . &#039;,&#039;;
+          $have[&#039;color&#039;] = true;
+        }
+      }
+    }
+
+    foreach ($background_prop_default as $bg_prop =&gt; $default_value) {
+      if ($return[$bg_prop] !== null) {
+        $return[$bg_prop] = substr($return[$bg_prop], 0, -1) . $important;
+      }
+      else {
+        $return[$bg_prop] = $default_value . $important;
+      }
+    }
+    return $return;
+  }
+
+  /**
+   * Merges all background properties
+   * @param array $input_css
+   * @return array
+   * @version 1.0
+   * @see dissolve_short_bg()
+   * @todo full CSS 3 compliance
+   */
+  function merge_bg($input_css) {
+    $background_prop_default = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;background_prop_default&#039;];
+    // Max number of background images. CSS3 not yet fully implemented
+    $number_of_values = @max(count(csstidy_optimise::explode_ws(&#039;,&#039;, $input_css[&#039;background-image&#039;])), count(csstidy_optimise::explode_ws(&#039;,&#039;, $input_css[&#039;background-color&#039;])), 1);
+    // Array with background images to check if BG image exists
+    $bg_img_array = @csstidy_optimise::explode_ws(&#039;,&#039;, csstidy::gvw_important($input_css[&#039;background-image&#039;]));
+    $new_bg_value = &#039;&#039;;
+    $important = &#039;&#039;;
+
+    // if background properties is here and not empty, don&#039;t try anything
+    if (isset($input_css[&#039;background&#039;]) AND $input_css[&#039;background&#039;]) {
+      return $input_css;
+    }
+
+    for ($i = 0; $i &lt; $number_of_values; $i++) {
+      foreach ($background_prop_default as $bg_property =&gt; $default_value) {
+        // Skip if property does not exist
+        if (!isset($input_css[$bg_property])) {
+          continue;
+        }
+
+        $cur_value = $input_css[$bg_property];
+        // skip all optimisation if gradient() somewhere
+        if (stripos($cur_value, &quot;gradient(&quot;) !== FALSE) {
+          return $input_css;
+        }
+
+        // Skip some properties if there is no background image
+        if ((!isset($bg_img_array[$i]) || $bg_img_array[$i] === &#039;none&#039;)
+								 &amp;&amp; ($bg_property === &#039;background-size&#039; || $bg_property === &#039;background-position&#039;
 								|| $bg_property === &#039;background-attachment&#039; || $bg_property === &#039;background-repeat&#039;)) {
-					continue;
-				}
+          continue;
+        }
 
-				// Remove !important
-				if (csstidy::is_important($cur_value)) {
-					$important = &#039; !important&#039;;
-					$cur_value = csstidy::gvw_important($cur_value);
-				}
-
-				// Do not add default values
-				if ($cur_value === $default_value) {
-					continue;
-				}
-
-				$temp = csstidy_optimise::explode_ws(&#039;,&#039;, $cur_value);
-
-				if (isset($temp[$i])) {
-					if ($bg_property === &#039;background-size&#039;) {
-						$new_bg_value .= &#039;(&#039; . $temp[$i] . &#039;) &#039;;
-					} else {
-						$new_bg_value .= $temp[$i] . &#039; &#039;;
-					}
-				}
-			}
-
-			$new_bg_value = trim($new_bg_value);
-			if ($i != $number_of_values - 1)
-				$new_bg_value .= &#039;,&#039;;
-		}
-
-		// Delete all background-properties
-		foreach ($background_prop_default as $bg_property =&gt; $default_value) {
-			unset($input_css[$bg_property]);
-		}
-
-		// Add new background property
-		if ($new_bg_value !== &#039;&#039;)
-			$input_css[&#039;background&#039;] = $new_bg_value . $important;
-		elseif(isset ($input_css[&#039;background&#039;]))
-			$input_css[&#039;background&#039;] = &#039;none&#039;;
-
-		return $input_css;
-	}
-
-	/**
-	 * Dissolve font property
-	 * @param string $str_value
-	 * @return array
-	 * @version 1.3
-	 * @see merge_font()
-	 */
-	function dissolve_short_font($str_value) {
-		$font_prop_default = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;font_prop_default&#039;];
-		$font_weight = array(&#039;normal&#039;, &#039;bold&#039;, &#039;bolder&#039;, &#039;lighter&#039;, 100, 200, 300, 400, 500, 600, 700, 800, 900);
-		$font_variant = array(&#039;normal&#039;, &#039;small-caps&#039;);
-		$font_style = array(&#039;normal&#039;, &#039;italic&#039;, &#039;oblique&#039;);
-		$important = &#039;&#039;;
-		$return = array(&#039;font-style&#039; =&gt; null, &#039;font-variant&#039; =&gt; null, &#039;font-weight&#039; =&gt; null, &#039;font-size&#039; =&gt; null, &#039;line-height&#039; =&gt; null, &#039;font-family&#039; =&gt; null);
-
-		if (csstidy::is_important($str_value)) {
-			$important = &#039;!important&#039;;
-			$str_value = csstidy::gvw_important($str_value);
-		}
-
-		$have[&#039;style&#039;] = false;
-		$have[&#039;variant&#039;] = false;
-		$have[&#039;weight&#039;] = false;
-		$have[&#039;size&#039;] = false;
-		// Detects if font-family consists of several words w/o quotes
-		$multiwords = false;
-
-		// Workaround with multiple font-family
-		$str_value = csstidy_optimise::explode_ws(&#039;,&#039;, trim($str_value));
-
-		$str_value[0] = csstidy_optimise::explode_ws(&#039; &#039;, trim($str_value[0]));
-
-		for ($j = 0; $j &lt; count($str_value[0]); $j++) {
-			if ($have[&#039;weight&#039;] === false &amp;&amp; in_array($str_value[0][$j], $font_weight)) {
-				$return[&#039;font-weight&#039;] = $str_value[0][$j];
-				$have[&#039;weight&#039;] = true;
-			} elseif ($have[&#039;variant&#039;] === false &amp;&amp; in_array($str_value[0][$j], $font_variant)) {
-				$return[&#039;font-variant&#039;] = $str_value[0][$j];
-				$have[&#039;variant&#039;] = true;
-			} elseif ($have[&#039;style&#039;] === false &amp;&amp; in_array($str_value[0][$j], $font_style)) {
-				$return[&#039;font-style&#039;] = $str_value[0][$j];
-				$have[&#039;style&#039;] = true;
-			} elseif ($have[&#039;size&#039;] === false &amp;&amp; (is_numeric($str_value[0][$j]{0}) || $str_value[0][$j]{0} === null || $str_value[0][$j]{0} === &#039;.&#039;)) {
-				$size = csstidy_optimise::explode_ws(&#039;/&#039;, trim($str_value[0][$j]));
-				$return[&#039;font-size&#039;] = $size[0];
-				if (isset($size[1])) {
-					$return[&#039;line-height&#039;] = $size[1];
-				} else {
-					$return[&#039;line-height&#039;] = &#039;&#039;; // don&#039;t add &#039;normal&#039; !
-				}
-				$have[&#039;size&#039;] = true;
-			} else {
-				if (isset($return[&#039;font-family&#039;])) {
-					$return[&#039;font-family&#039;] .= &#039; &#039; . $str_value[0][$j];
-					$multiwords = true;
-				} else {
-					$return[&#039;font-family&#039;] = $str_value[0][$j];
-				}
-			}
-		}
-		// add quotes if we have several qords in font-family
-		if ($multiwords !== false) {
-			$return[&#039;font-family&#039;] = &#039;&quot;&#039; . $return[&#039;font-family&#039;] . &#039;&quot;&#039;;
-		}
-		$i = 1;
-		while (isset($str_value[$i])) {
-			$return[&#039;font-family&#039;] .= &#039;,&#039; . trim($str_value[$i]);
-			$i++;
-		}
+        // Remove !important
+        if (csstidy::is_important($cur_value)) {
+          $important = &#039; !important&#039;;
+          $cur_value = csstidy::gvw_important($cur_value);
+        }
+
+        // Do not add default values
+        if ($cur_value === $default_value) {
+          continue;
+        }
+
+        $temp = csstidy_optimise::explode_ws(&#039;,&#039;, $cur_value);
+
+        if (isset($temp[$i])) {
+          if ($bg_property === &#039;background-size&#039;) {
+            $new_bg_value .= &#039;(&#039; . $temp[$i] . &#039;) &#039;;
+          }
+          else {
+            $new_bg_value .= $temp[$i] . &#039; &#039;;
+          }
+        }
+      }
+
+      $new_bg_value = trim($new_bg_value);
+      if ($i != $number_of_values - 1) {
+        $new_bg_value .= &#039;,&#039;;
+      }
+    }
+
+    // Delete all background-properties
+    foreach ($background_prop_default as $bg_property =&gt; $default_value) {
+      unset($input_css[$bg_property]);
+    }
+
+    // Add new background property
+    if ($new_bg_value !== &#039;&#039;) {
+      $input_css[&#039;background&#039;] = $new_bg_value . $important;
+    }
+    elseif (isset($input_css[&#039;background&#039;])) {
+      $input_css[&#039;background&#039;] = &#039;none&#039;;
+    }
+
+    return $input_css;
+  }
+
+  /**
+   * Dissolve font property
+   * @param string $str_value
+   * @return array
+   * @version 1.3
+   * @see merge_font()
+   */
+  function dissolve_short_font($str_value) {
+    $font_prop_default = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;font_prop_default&#039;];
+    $font_weight = array(&#039;normal&#039;, &#039;bold&#039;, &#039;bolder&#039;, &#039;lighter&#039;, 100, 200, 300, 400, 500, 600, 700, 800, 900);
+    $font_variant = array(&#039;normal&#039;, &#039;small-caps&#039;);
+    $font_style = array(&#039;normal&#039;, &#039;italic&#039;, &#039;oblique&#039;);
+    $important = &#039;&#039;;
+    $return = array(
+      &#039;font-style&#039; =&gt; null,
+      &#039;font-variant&#039; =&gt; null,
+      &#039;font-weight&#039; =&gt; null,
+      &#039;font-size&#039; =&gt; null,
+      &#039;line-height&#039; =&gt; null,
+      &#039;font-family&#039; =&gt; null,
+    );
+
+    if (csstidy::is_important($str_value)) {
+      $important = &#039;!important&#039;;
+      $str_value = csstidy::gvw_important($str_value);
+    }
+
+    $have[&#039;style&#039;] = false;
+    $have[&#039;variant&#039;] = false;
+    $have[&#039;weight&#039;] = false;
+    $have[&#039;size&#039;] = false;
+    // Detects if font-family consists of several words w/o quotes
+    $multiwords = false;
+
+    // Workaround with multiple font-family
+    $str_value = csstidy_optimise::explode_ws(&#039;,&#039;, trim($str_value));
+
+    $str_value[0] = csstidy_optimise::explode_ws(&#039; &#039;, trim($str_value[0]));
+
+    for ($j = 0; $j &lt; count($str_value[0]); $j++) {
+      if ($have[&#039;weight&#039;] === false &amp;&amp; in_array($str_value[0][$j], $font_weight)) {
+        $return[&#039;font-weight&#039;] = $str_value[0][$j];
+        $have[&#039;weight&#039;] = true;
+      }
+      elseif ($have[&#039;variant&#039;] === false &amp;&amp; in_array($str_value[0][$j], $font_variant)) {
+        $return[&#039;font-variant&#039;] = $str_value[0][$j];
+        $have[&#039;variant&#039;] = true;
+      }
+      elseif ($have[&#039;style&#039;] === false &amp;&amp; in_array($str_value[0][$j], $font_style)) {
+        $return[&#039;font-style&#039;] = $str_value[0][$j];
+        $have[&#039;style&#039;] = true;
+      }
+      elseif ($have[&#039;size&#039;] === false &amp;&amp; (is_numeric($str_value[0][$j]{0}) || $str_value[0][$j]{0} === null || $str_value[0][$j]{0} === &#039;.&#039;)) {
+        $size = csstidy_optimise::explode_ws(&#039;/&#039;, trim($str_value[0][$j]));
+        $return[&#039;font-size&#039;] = $size[0];
+        if (isset($size[1])) {
+          $return[&#039;line-height&#039;] = $size[1];
+        }
+        else {
+          $return[&#039;line-height&#039;] = &#039;&#039;; // don&#039;t add &#039;normal&#039; !
+        }
+        $have[&#039;size&#039;] = true;
+      }
+      else {
+        if (isset($return[&#039;font-family&#039;])) {
+          $return[&#039;font-family&#039;] .= &#039; &#039; . $str_value[0][$j];
+          $multiwords = true;
+        }
+        else {
+          $return[&#039;font-family&#039;] = $str_value[0][$j];
+        }
+      }
+    }
+    // add quotes if we have several qords in font-family
+    if ($multiwords !== false) {
+      $return[&#039;font-family&#039;] = &#039;&quot;&#039; . $return[&#039;font-family&#039;] . &#039;&quot;&#039;;
+    }
+    $i = 1;
+    while (isset($str_value[$i])) {
+      $return[&#039;font-family&#039;] .= &#039;,&#039; . trim($str_value[$i]);
+      $i++;
+    }
 
-		// Fix for 100 and more font-size
-		if ($have[&#039;size&#039;] === false &amp;&amp; isset($return[&#039;font-weight&#039;]) &amp;&amp;
+    // Fix for 100 and more font-size
+    if ($have[&#039;size&#039;] === false &amp;&amp; isset($return[&#039;font-weight&#039;]) &amp;&amp;
 						is_numeric($return[&#039;font-weight&#039;]{0})) {
-			$return[&#039;font-size&#039;] = $return[&#039;font-weight&#039;];
-			unset($return[&#039;font-weight&#039;]);
-		}
-
-		foreach ($font_prop_default as $font_prop =&gt; $default_value) {
-			if ($return[$font_prop] !== null) {
-				$return[$font_prop] = $return[$font_prop] . $important;
-			}
-			else
-				$return[$font_prop] = $default_value . $important;
-		}
-		return $return;
-	}
-
-	/**
-	 * Merges all fonts properties
-	 * @param array $input_css
-	 * @return array
-	 * @version 1.3
-	 * @see dissolve_short_font()
-	 */
-	function merge_font($input_css) {
-		$font_prop_default = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;font_prop_default&#039;];
-		$new_font_value = &#039;&#039;;
-		$important = &#039;&#039;;
-		// Skip if not font-family and font-size set
-		if (isset($input_css[&#039;font-family&#039;]) &amp;&amp; isset($input_css[&#039;font-size&#039;])) {
-			// fix several words in font-family - add quotes
-			if (isset($input_css[&#039;font-family&#039;])) {
-				$families = explode(&quot;,&quot;, $input_css[&#039;font-family&#039;]);
-				$result_families = array();
-				foreach ($families as $family) {
-					$family = trim($family);
-					$len = strlen($family);
-					if (strpos($family, &quot; &quot;) &amp;&amp;
+      $return[&#039;font-size&#039;] = $return[&#039;font-weight&#039;];
+      unset($return[&#039;font-weight&#039;]);
+    }
+
+    foreach ($font_prop_default as $font_prop =&gt; $default_value) {
+      if ($return[$font_prop] !== null) {
+        $return[$font_prop] = $return[$font_prop] . $important;
+      }
+      else {
+        $return[$font_prop] = $default_value . $important;
+      }
+    }
+    return $return;
+  }
+
+  /**
+   * Merges all fonts properties
+   * @param array $input_css
+   * @return array
+   * @version 1.3
+   * @see dissolve_short_font()
+   */
+  function merge_font($input_css) {
+    $font_prop_default = &amp; $GLOBALS[&#039;csstidy&#039;][&#039;font_prop_default&#039;];
+    $new_font_value = &#039;&#039;;
+    $important = &#039;&#039;;
+    // Skip if not font-family and font-size set
+    if (isset($input_css[&#039;font-family&#039;]) &amp;&amp; isset($input_css[&#039;font-size&#039;])) {
+      // fix several words in font-family - add quotes
+      if (isset($input_css[&#039;font-family&#039;])) {
+        $families = explode(&quot;,&quot;, $input_css[&#039;font-family&#039;]);
+        $result_families = array();
+        foreach ($families as $family) {
+          $family = trim($family);
+          $len = strlen($family);
+          if (strpos($family, &quot; &quot;) &amp;&amp;
 									!(($family{0} == &#039;&quot;&#039; &amp;&amp; $family{$len - 1} == &#039;&quot;&#039;) ||
 									($family{0} == &quot;&#039;&quot; &amp;&amp; $family{$len - 1} == &quot;&#039;&quot;))) {
-						$family = &#039;&quot;&#039; . $family . &#039;&quot;&#039;;
-					}
-					$result_families[] = $family;
-				}
-				$input_css[&#039;font-family&#039;] = implode(&quot;,&quot;, $result_families);
-			}
-			foreach ($font_prop_default as $font_property =&gt; $default_value) {
-
-				// Skip if property does not exist
-				if (!isset($input_css[$font_property])) {
-					continue;
-				}
-
-				$cur_value = $input_css[$font_property];
-
-				// Skip if default value is used
-				if ($cur_value === $default_value) {
-					continue;
-				}
-
-				// Remove !important
-				if (csstidy::is_important($cur_value)) {
-					$important = &#039;!important&#039;;
-					$cur_value = csstidy::gvw_important($cur_value);
-				}
-
-				$new_font_value .= $cur_value;
-				// Add delimiter
-				$new_font_value .= ( $font_property === &#039;font-size&#039; &amp;&amp;
+            $family = &#039;&quot;&#039; . $family . &#039;&quot;&#039;;
+          }
+          $result_families[] = $family;
+        }
+        $input_css[&#039;font-family&#039;] = implode(&quot;,&quot;, $result_families);
+      }
+      foreach ($font_prop_default as $font_property =&gt; $default_value) {
+
+        // Skip if property does not exist
+        if (!isset($input_css[$font_property])) {
+          continue;
+        }
+
+        $cur_value = $input_css[$font_property];
+
+        // Skip if default value is used
+        if ($cur_value === $default_value) {
+          continue;
+        }
+
+        // Remove !important
+        if (csstidy::is_important($cur_value)) {
+          $important = &#039;!important&#039;;
+          $cur_value = csstidy::gvw_important($cur_value);
+        }
+
+        $new_font_value .= $cur_value;
+        // Add delimiter
+        $new_font_value .= ( $font_property === &#039;font-size&#039; &amp;&amp;
 								isset($input_css[&#039;line-height&#039;])) ? &#039;/&#039; : &#039; &#039;;
-			}
+      }
 
-			$new_font_value = trim($new_font_value);
+      $new_font_value = trim($new_font_value);
 
-			// Delete all font-properties
-			foreach ($font_prop_default as $font_property =&gt; $default_value) {
-				if ($font_property!==&#039;font&#039; OR !$new_font_value)
-					unset($input_css[$font_property]);
-			}
-
-			// Add new font property
-			if ($new_font_value !== &#039;&#039;) {
-				$input_css[&#039;font&#039;] = $new_font_value . $important;
-			}
-		}
+      // Delete all font-properties
+      foreach ($font_prop_default as $font_property =&gt; $default_value) {
+        if ($font_property !== &#039;font&#039; OR !$new_font_value) {
+          unset($input_css[$font_property]);
+        }
+      }
+
+      // Add new font property
+      if ($new_font_value !== &#039;&#039;) {
+        $input_css[&#039;font&#039;] = $new_font_value . $important;
+      }
+    }
 
-		return $input_css;
-	}
+    return $input_css;
+  }
 
 }
diff -up -r advagg_css_compress/csstidy/class.csstidy_print.inc advagg_css_compress/csstidy/class.csstidy_print.inc
--- advagg_css_compress/csstidy/class.csstidy_print.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/csstidy/class.csstidy_print.inc	2012-03-23 13:02:21.000000000 -0600
@@ -19,7 +19,7 @@
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *   GNU Lesser General Public License for more details.
- * 
+ *
  *   You should have received a copy of the GNU Lesser General Public License
  *   along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
  *
@@ -41,366 +41,376 @@
  */
 class csstidy_print {
 
-	/**
-	 * Saves the input CSS string
-	 * @var string
-	 * @access private
-	 */
-	var $input_css = &#039;&#039;;
-	/**
-	 * Saves the formatted CSS string
-	 * @var string
-	 * @access public
-	 */
-	var $output_css = &#039;&#039;;
-	/**
-	 * Saves the formatted CSS string (plain text)
-	 * @var string
-	 * @access public
-	 */
-	var $output_css_plain = &#039;&#039;;
-
-	/**
-	 * Constructor
-	 * @param array $css contains the class csstidy
-	 * @access private
-	 * @version 1.0
-	 */
-	function csstidy_print(&amp;$css) {
-		$this-&gt;parser = &amp; $css;
-		$this-&gt;css = &amp; $css-&gt;css;
-		$this-&gt;template = &amp; $css-&gt;template;
-		$this-&gt;tokens = &amp; $css-&gt;tokens;
-		$this-&gt;charset = &amp; $css-&gt;charset;
-		$this-&gt;import = &amp; $css-&gt;import;
-		$this-&gt;namespace = &amp; $css-&gt;namespace;
-	}
-
-	/**
-	 * Resets output_css and output_css_plain (new css code)
-	 * @access private
-	 * @version 1.0
-	 */
-	function _reset() {
-		$this-&gt;output_css = &#039;&#039;;
-		$this-&gt;output_css_plain = &#039;&#039;;
-	}
-
-	/**
-	 * Returns the CSS code as plain text
-	 * @param string $default_media default @media to add to selectors without any @media
-	 * @return string
-	 * @access public
-	 * @version 1.0
-	 */
-	function plain($default_media=&#039;&#039;) {
-		$this-&gt;_print(true, $default_media);
-		return $this-&gt;output_css_plain;
-	}
-
-	/**
-	 * Returns the formatted CSS code
-	 * @param string $default_media default @media to add to selectors without any @media
-	 * @return string
-	 * @access public
-	 * @version 1.0
-	 */
-	function formatted($default_media=&#039;&#039;) {
-		$this-&gt;_print(false, $default_media);
-		return $this-&gt;output_css;
-	}
-
-	/**
-	 * Returns the formatted CSS code to make a complete webpage
-	 * @param string $doctype shorthand for the document type
-	 * @param bool $externalcss indicates whether styles to be attached internally or as an external stylesheet
-	 * @param string $title title to be added in the head of the document
-	 * @param string $lang two-letter language code to be added to the output
-	 * @return string
-	 * @access public
-	 * @version 1.4
-	 */
-	function formatted_page($doctype=&#039;xhtml1.1&#039;, $externalcss=true, $title=&#039;&#039;, $lang=&#039;en&#039;) {
-		switch ($doctype) {
-			case &#039;xhtml1.0strict&#039;:
-				$doctype_output = &#039;&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
+  /**
+   * Saves the input CSS string
+   * @var string
+   * @access private
+   */
+  var $input_css = &#039;&#039;;
+  /**
+   * Saves the formatted CSS string
+   * @var string
+   * @access public
+   */
+  var $output_css = &#039;&#039;;
+  /**
+   * Saves the formatted CSS string (plain text)
+   * @var string
+   * @access public
+   */
+  var $output_css_plain = &#039;&#039;;
+
+  /**
+   * Constructor
+   * @param array $css contains the class csstidy
+   * @access private
+   * @version 1.0
+   */
+  function csstidy_print(&amp;$css) {
+    $this-&gt;parser = &amp; $css;
+    $this-&gt;css = &amp; $css-&gt;css;
+    $this-&gt;template = &amp; $css-&gt;template;
+    $this-&gt;tokens = &amp; $css-&gt;tokens;
+    $this-&gt;charset = &amp; $css-&gt;charset;
+    $this-&gt;import = &amp; $css-&gt;import;
+    $this-&gt;namespace = &amp; $css-&gt;namespace;
+  }
+
+  /**
+   * Resets output_css and output_css_plain (new css code)
+   * @access private
+   * @version 1.0
+   */
+  function _reset() {
+    $this-&gt;output_css = &#039;&#039;;
+    $this-&gt;output_css_plain = &#039;&#039;;
+  }
+
+  /**
+   * Returns the CSS code as plain text
+   * @param string $default_media default @media to add to selectors without any @media
+   * @return string
+   * @access public
+   * @version 1.0
+   */
+  function plain($default_media = &#039;&#039;) {
+    $this-&gt;_print(true, $default_media);
+    return $this-&gt;output_css_plain;
+  }
+
+  /**
+   * Returns the formatted CSS code
+   * @param string $default_media default @media to add to selectors without any @media
+   * @return string
+   * @access public
+   * @version 1.0
+   */
+  function formatted($default_media = &#039;&#039;) {
+    $this-&gt;_print(false, $default_media);
+    return $this-&gt;output_css;
+  }
+
+  /**
+   * Returns the formatted CSS code to make a complete webpage
+   * @param string $doctype shorthand for the document type
+   * @param bool $externalcss indicates whether styles to be attached internally or as an external stylesheet
+   * @param string $title title to be added in the head of the document
+   * @param string $lang two-letter language code to be added to the output
+   * @return string
+   * @access public
+   * @version 1.4
+   */
+  function formatted_page($doctype = &#039;xhtml1.1&#039;, $externalcss = true, $title = &#039;&#039;, $lang = &#039;en&#039;) {
+    switch ($doctype) {
+      case &#039;xhtml1.0strict&#039;:
+        $doctype_output = &#039;&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
 			&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;&#039;;
-				break;
-			case &#039;xhtml1.1&#039;:
-			default:
-				$doctype_output = &#039;&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot;
+        break;
+      case &#039;xhtml1.1&#039;:
+      default:
+        $doctype_output = &#039;&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot;
 				&quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;&#039;;
-				break;
-		}
+        break;
+    }
 
-		$output = $cssparsed = &#039;&#039;;
-		$this-&gt;output_css_plain = &amp; $output;
+    $output = $cssparsed = &#039;&#039;;
+    $this-&gt;output_css_plain = &amp; $output;
 
-		$output .= $doctype_output . &quot;\n&quot; . &#039;&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;&#039; . $lang . &#039;&quot;&#039;;
-		$output .= ( $doctype === &#039;xhtml1.1&#039;) ? &#039;&gt;&#039; : &#039; lang=&quot;&#039; . $lang . &#039;&quot;&gt;&#039;;
-		$output .= &quot;\n&lt;head&gt;\n    &lt;title&gt;$title&lt;/title&gt;&quot;;
-
-		if ($externalcss) {
-			$output .= &quot;\n    &lt;style type=\&quot;text/css\&quot;&gt;\n&quot;;
-			$cssparsed = file_get_contents(&#039;cssparsed.css&#039;);
-			$output .= $cssparsed; // Adds an invisible BOM or something, but not in css_optimised.php
-			$output .= &quot;\n&lt;/style&gt;&quot;;
-		} else {
-			$output .= &quot;\n&quot; . &#039;    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;cssparsed.css&quot; /&gt;&#039;;
-//			}
-		}
-		$output .= &quot;\n&lt;/head&gt;\n&lt;body&gt;&lt;code id=\&quot;copytext\&quot;&gt;&quot;;
-		$output .= $this-&gt;formatted();
-		$output .= &#039;&lt;/code&gt;&#039; . &quot;\n&quot; . &#039;&lt;/body&gt;&lt;/html&gt;&#039;;
-		return $this-&gt;output_css_plain;
-	}
-
-	/**
-	 * Returns the formatted CSS Code and saves it into $this-&gt;output_css and $this-&gt;output_css_plain
-	 * @param bool $plain plain text or not
-	 * @param string $default_media default @media to add to selectors without any @media
-	 * @access private
-	 * @version 2.0
-	 */
-	function _print($plain = false, $default_media=&#039;&#039;) {
-		if ($this-&gt;output_css &amp;&amp; $this-&gt;output_css_plain) {
-			return;
-		}
-
-		$output = &#039;&#039;;
-		if (!$this-&gt;parser-&gt;get_cfg(&#039;preserve_css&#039;)) {
-			$this-&gt;_convert_raw_css($default_media);
-		}
-
-		$template = &amp; $this-&gt;template;
-
-		if ($plain) {
-			$template = array_map(&#039;strip_tags&#039;, $template);
-		}
-
-		if ($this-&gt;parser-&gt;get_cfg(&#039;timestamp&#039;)) {
-			array_unshift($this-&gt;tokens, array(COMMENT, &#039; CSSTidy &#039; . $this-&gt;parser-&gt;version . &#039;: &#039; . date(&#039;r&#039;) . &#039; &#039;));
-		}
-
-		if (!empty($this-&gt;charset)) {
-			$output .= $template[0] . &#039;@charset &#039; . $template[5] . $this-&gt;charset . $template[6];
-		}
-
-		if (!empty($this-&gt;import)) {
-			for ($i = 0, $size = count($this-&gt;import); $i &lt; $size; $i++) {
-				if (substr($this-&gt;import[$i], 0, 4) === &#039;url(&#039; &amp;&amp; substr($this-&gt;import[$i], -1, 1) === &#039;)&#039;) {
-					$this-&gt;import[$i] = &#039;\&#039;&#039; . substr($this-&gt;import[$i], 4, -1) . &#039;\&#039;&#039;;
-					$this-&gt;parser-&gt;log(&#039;Optimised @import : Removed &quot;url(&quot;&#039;, &#039;Information&#039;);
-				}
-				$output .= $template[0] . &#039;@import &#039; . $template[5] . $this-&gt;import[$i] . $template[6];
-			}
-		}
-
-		if (!empty($this-&gt;namespace)) {
-			if (substr($this-&gt;namespace, 0, 4) === &#039;url(&#039; &amp;&amp; substr($this-&gt;namespace, -1, 1) === &#039;)&#039;) {
-				$this-&gt;namespace = &#039;\&#039;&#039; . substr($this-&gt;namespace, 4, -1) . &#039;\&#039;&#039;;
-				$this-&gt;parser-&gt;log(&#039;Optimised @namespace : Removed &quot;url(&quot;&#039;, &#039;Information&#039;);
-			}
-			$output .= $template[0] . &#039;@namespace &#039; . $template[5] . $this-&gt;namespace . $template[6];
-		}
-
-		$output .= $template[13];
-		$in_at_out = &#039;&#039;;
-		$out = &amp; $output;
-
-		foreach ($this-&gt;tokens as $key =&gt; $token) {
-			switch ($token[0]) {
-				case AT_START:
-					$out .= $template[0] . $this-&gt;_htmlsp($token[1], $plain) . $template[1];
-					$out = &amp; $in_at_out;
-					break;
-
-				case SEL_START:
-					if ($this-&gt;parser-&gt;get_cfg(&#039;lowercase_s&#039;))
-						$token[1] = strtolower($token[1]);
-					$out .= ( $token[1]{0} !== &#039;@&#039;) ? $template[2] . $this-&gt;_htmlsp($token[1], $plain) : $template[0] . $this-&gt;_htmlsp($token[1], $plain);
-					$out .= $template[3];
-					break;
-
-				case PROPERTY:
-					if ($this-&gt;parser-&gt;get_cfg(&#039;case_properties&#039;) === 2) {
-						$token[1] = strtoupper($token[1]);
-					} elseif ($this-&gt;parser-&gt;get_cfg(&#039;case_properties&#039;) === 1) {
-						$token[1] = strtolower($token[1]);
-					}
-					$out .= $template[4] . $this-&gt;_htmlsp($token[1], $plain) . &#039;:&#039; . $template[5];
-					break;
-
-				case VALUE:
-					$out .= $this-&gt;_htmlsp($token[1], $plain);
-					if ($this-&gt;_seeknocomment($key, 1) == SEL_END &amp;&amp; $this-&gt;parser-&gt;get_cfg(&#039;remove_last_;&#039;)) {
-						$out .= str_replace(&#039;;&#039;, &#039;&#039;, $template[6]);
-					} else {
-						$out .= $template[6];
-					}
-					break;
-
-				case SEL_END:
-					$out .= $template[7];
-					if ($this-&gt;_seeknocomment($key, 1) != AT_END)
-						$out .= $template[8];
-					break;
-
-				case AT_END:
-					$out = &amp; $output;
-					$out .= $template[10] . str_replace(&quot;\n&quot;, &quot;\n&quot; . $template[10], $in_at_out);
-					$in_at_out = &#039;&#039;;
-					$out .= $template[9];
-					break;
-
-				case COMMENT:
-					$out .= $template[11] . &#039;/*&#039; . $this-&gt;_htmlsp($token[1], $plain) . &#039;*/&#039; . $template[12];
-					break;
-			}
-		}
-
-		$output = trim($output);
-
-		if (!$plain) {
-			$this-&gt;output_css = $output;
-			$this-&gt;_print(true);
-		} else {
-			// If using spaces in the template, don&#039;t want these to appear in the plain output
-			$this-&gt;output_css_plain = str_replace(&#039;&amp;#160;&#039;, &#039;&#039;, $output);
-		}
-	}
-
-	/**
-	 * Gets the next token type which is $move away from $key, excluding comments
-	 * @param integer $key current position
-	 * @param integer $move move this far
-	 * @return mixed a token type
-	 * @access private
-	 * @version 1.0
-	 */
-	function _seeknocomment($key, $move) {
-		$go = ($move &gt; 0) ? 1 : -1;
-		for ($i = $key + 1; abs($key - $i) - 1 &lt; abs($move); $i += $go) {
-			if (!isset($this-&gt;tokens[$i])) {
-				return;
-			}
-			if ($this-&gt;tokens[$i][0] == COMMENT) {
-				$move += 1;
-				continue;
-			}
-			return $this-&gt;tokens[$i][0];
-		}
-	}
-
-	/**
-	 * Converts $this-&gt;css array to a raw array ($this-&gt;tokens)
-	 * @param string $default_media default @media to add to selectors without any @media
-	 * @access private
-	 * @version 1.0
-	 */
-	function _convert_raw_css($default_media=&#039;&#039;) {
-		$this-&gt;tokens = array();
-
-		foreach ($this-&gt;css as $medium =&gt; $val) {
-			if ($this-&gt;parser-&gt;get_cfg(&#039;sort_selectors&#039;))
-				ksort($val);
-			if (intval($medium) &lt; DEFAULT_AT) {
-				$this-&gt;parser-&gt;_add_token(AT_START, $medium, true);
-			}
-			elseif ($default_media) {
-				$this-&gt;parser-&gt;_add_token(AT_START, $default_media, true);
-			}
-			
-			foreach ($val as $selector =&gt; $vali) {
-				if ($this-&gt;parser-&gt;get_cfg(&#039;sort_properties&#039;))
-					ksort($vali);
-				$this-&gt;parser-&gt;_add_token(SEL_START, $selector, true);
-
-				foreach ($vali as $property =&gt; $valj) {
-					$this-&gt;parser-&gt;_add_token(PROPERTY, $property, true);
-					$this-&gt;parser-&gt;_add_token(VALUE, $valj, true);
-				}
-
-				$this-&gt;parser-&gt;_add_token(SEL_END, $selector, true);
-			}
-
-			if (intval($medium) &lt; DEFAULT_AT) {
-				$this-&gt;parser-&gt;_add_token(AT_END, $medium, true);
-			}
-			elseif ($default_media) {
-				$this-&gt;parser-&gt;_add_token(AT_END, $default_media, true);
-			}
-		}
-	}
-
-	/**
-	 * Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes  print_code() cleaner.
-	 * @param string $string
-	 * @param bool $plain
-	 * @return string
-	 * @see csstidy_print::_print()
-	 * @access private
-	 * @version 1.0
-	 */
-	function _htmlsp($string, $plain) {
-		if (!$plain) {
-			return htmlspecialchars($string, ENT_QUOTES, &#039;utf-8&#039;);
-		}
-		return $string;
-	}
-
-	/**
-	 * Get compression ratio
-	 * @access public
-	 * @return float
-	 * @version 1.2
-	 */
-	function get_ratio() {
-		if (!$this-&gt;output_css_plain) {
-			$this-&gt;formatted();
-		}
-		return round((strlen($this-&gt;input_css) - strlen($this-&gt;output_css_plain)) / strlen($this-&gt;input_css), 3) * 100;
-	}
-
-	/**
-	 * Get difference between the old and new code in bytes and prints the code if necessary.
-	 * @access public
-	 * @return string
-	 * @version 1.1
-	 */
-	function get_diff() {
-		if (!$this-&gt;output_css_plain) {
-			$this-&gt;formatted();
-		}
-
-		$diff = strlen($this-&gt;output_css_plain) - strlen($this-&gt;input_css);
-
-		if ($diff &gt; 0) {
-			return &#039;+&#039; . $diff;
-		} elseif ($diff == 0) {
-			return &#039;+-&#039; . $diff;
-		}
-
-		return $diff;
-	}
-
-	/**
-	 * Get the size of either input or output CSS in KB
-	 * @param string $loc default is &quot;output&quot;
-	 * @access public
-	 * @return integer
-	 * @version 1.0
-	 */
-	function size($loc = &#039;output&#039;) {
-		if ($loc === &#039;output&#039; &amp;&amp; !$this-&gt;output_css) {
-			$this-&gt;formatted();
-		}
-
-		if ($loc === &#039;input&#039;) {
-			return (strlen($this-&gt;input_css) / 1000);
-		} else {
-			return (strlen($this-&gt;output_css_plain) / 1000);
-		}
-	}
+    $output .= $doctype_output . &quot;\n&quot; . &#039;&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;&#039; . $lang . &#039;&quot;&#039;;
+    $output .= ( $doctype === &#039;xhtml1.1&#039;) ? &#039;&gt;&#039; : &#039; lang=&quot;&#039; . $lang . &#039;&quot;&gt;&#039;;
+    $output .= &quot;\n&lt;head&gt;\n    &lt;title&gt;$title&lt;/title&gt;&quot;;
+
+    if ($externalcss) {
+      $output .= &quot;\n    &lt;style type=\&quot;text/css\&quot;&gt;\n&quot;;
+      $cssparsed = file_get_contents(&#039;cssparsed.css&#039;);
+      $output .= $cssparsed; // Adds an invisible BOM or something, but not in css_optimised.php
+      $output .= &quot;\n&lt;/style&gt;&quot;;
+    }
+    else {
+      $output .= &quot;\n&quot; . &#039;    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;cssparsed.css&quot; /&gt;&#039;;
+      //			}
+    }
+    $output .= &quot;\n&lt;/head&gt;\n&lt;body&gt;&lt;code id=\&quot;copytext\&quot;&gt;&quot;;
+    $output .= $this-&gt;formatted();
+    $output .= &#039;&lt;/code&gt;&#039; . &quot;\n&quot; . &#039;&lt;/body&gt;&lt;/html&gt;&#039;;
+    return $this-&gt;output_css_plain;
+  }
+
+  /**
+   * Returns the formatted CSS Code and saves it into $this-&gt;output_css and $this-&gt;output_css_plain
+   * @param bool $plain plain text or not
+   * @param string $default_media default @media to add to selectors without any @media
+   * @access private
+   * @version 2.0
+   */
+  function _print($plain = false, $default_media = &#039;&#039;) {
+    if ($this-&gt;output_css &amp;&amp; $this-&gt;output_css_plain) {
+      return;
+    }
+
+    $output = &#039;&#039;;
+    if (!$this-&gt;parser-&gt;get_cfg(&#039;preserve_css&#039;)) {
+      $this-&gt;_convert_raw_css($default_media);
+    }
+
+    $template = &amp; $this-&gt;template;
+
+    if ($plain) {
+      $template = array_map(&#039;strip_tags&#039;, $template);
+    }
+
+    if ($this-&gt;parser-&gt;get_cfg(&#039;timestamp&#039;)) {
+      array_unshift($this-&gt;tokens, array(COMMENT, &#039; CSSTidy &#039; . $this-&gt;parser-&gt;version . &#039;: &#039; . date(&#039;r&#039;) . &#039; &#039;));
+    }
+
+    if (!empty($this-&gt;charset)) {
+      $output .= $template[0] . &#039;@charset &#039; . $template[5] . $this-&gt;charset . $template[6];
+    }
+
+    if (!empty($this-&gt;import)) {
+      for ($i = 0, $size = count($this-&gt;import); $i &lt; $size; $i++) {
+        if (substr($this-&gt;import[$i], 0, 4) === &#039;url(&#039; &amp;&amp; substr($this-&gt;import[$i], -1, 1) === &#039;)&#039;) {
+          $this-&gt;import[$i] = &#039;\&#039;&#039; . substr($this-&gt;import[$i], 4, -1) . &#039;\&#039;&#039;;
+          $this-&gt;parser-&gt;log(&#039;Optimised @import : Removed &quot;url(&quot;&#039;, &#039;Information&#039;);
+        }
+        $output .= $template[0] . &#039;@import &#039; . $template[5] . $this-&gt;import[$i] . $template[6];
+      }
+    }
+
+    if (!empty($this-&gt;namespace)) {
+      if (substr($this-&gt;namespace, 0, 4) === &#039;url(&#039; &amp;&amp; substr($this-&gt;namespace, -1, 1) === &#039;)&#039;) {
+        $this-&gt;namespace = &#039;\&#039;&#039; . substr($this-&gt;namespace, 4, -1) . &#039;\&#039;&#039;;
+        $this-&gt;parser-&gt;log(&#039;Optimised @namespace : Removed &quot;url(&quot;&#039;, &#039;Information&#039;);
+      }
+      $output .= $template[0] . &#039;@namespace &#039; . $template[5] . $this-&gt;namespace . $template[6];
+    }
+
+    $output .= $template[13];
+    $in_at_out = &#039;&#039;;
+    $out = &amp; $output;
+
+    foreach ($this-&gt;tokens as $key =&gt; $token) {
+      switch ($token[0]) {
+        case AT_START:
+          $out .= $template[0] . $this-&gt;_htmlsp($token[1], $plain) . $template[1];
+          $out = &amp; $in_at_out;
+          break;
+
+        case SEL_START:
+          if ($this-&gt;parser-&gt;get_cfg(&#039;lowercase_s&#039;)) {
+            $token[1] = strtolower($token[1]);
+          }
+          $out .= ( $token[1]{0} !== &#039;@&#039;) ? $template[2] . $this-&gt;_htmlsp($token[1], $plain) : $template[0] . $this-&gt;_htmlsp($token[1], $plain);
+          $out .= $template[3];
+          break;
+
+        case PROPERTY:
+          if ($this-&gt;parser-&gt;get_cfg(&#039;case_properties&#039;) === 2) {
+            $token[1] = strtoupper($token[1]);
+          }
+          elseif ($this-&gt;parser-&gt;get_cfg(&#039;case_properties&#039;) === 1) {
+            $token[1] = strtolower($token[1]);
+          }
+          $out .= $template[4] . $this-&gt;_htmlsp($token[1], $plain) . &#039;:&#039; . $template[5];
+          break;
+
+        case VALUE:
+          $out .= $this-&gt;_htmlsp($token[1], $plain);
+          if ($this-&gt;_seeknocomment($key, 1) == SEL_END &amp;&amp; $this-&gt;parser-&gt;get_cfg(&#039;remove_last_;&#039;)) {
+            $out .= str_replace(&#039;;&#039;, &#039;&#039;, $template[6]);
+          }
+          else {
+            $out .= $template[6];
+          }
+          break;
+
+        case SEL_END:
+          $out .= $template[7];
+          if ($this-&gt;_seeknocomment($key, 1) != AT_END) {
+            $out .= $template[8];
+          }
+          break;
+
+        case AT_END:
+          $out = &amp; $output;
+          $out .= $template[10] . str_replace(&quot;\n&quot;, &quot;\n&quot; . $template[10], $in_at_out);
+          $in_at_out = &#039;&#039;;
+          $out .= $template[9];
+          break;
+
+        case COMMENT:
+          $out .= $template[11] . &#039;/*&#039; . $this-&gt;_htmlsp($token[1], $plain) . &#039;*/&#039; . $template[12];
+          break;
+      }
+    }
+
+    $output = trim($output);
+
+    if (!$plain) {
+      $this-&gt;output_css = $output;
+      $this-&gt;_print(true);
+    }
+    else {
+      // If using spaces in the template, don&#039;t want these to appear in the plain output
+      $this-&gt;output_css_plain = str_replace(&#039;&amp;#160;&#039;, &#039;&#039;, $output);
+    }
+  }
+
+  /**
+   * Gets the next token type which is $move away from $key, excluding comments
+   * @param integer $key current position
+   * @param integer $move move this far
+   * @return mixed a token type
+   * @access private
+   * @version 1.0
+   */
+  function _seeknocomment($key, $move) {
+    $go = ($move &gt; 0) ? 1 : -1;
+    for ($i = $key + 1; abs($key - $i) - 1 &lt; abs($move); $i += $go) {
+      if (!isset($this-&gt;tokens[$i])) {
+        return;
+      }
+      if ($this-&gt;tokens[$i][0] == COMMENT) {
+        $move += 1;
+        continue;
+      }
+      return $this-&gt;tokens[$i][0];
+    }
+  }
+
+  /**
+   * Converts $this-&gt;css array to a raw array ($this-&gt;tokens)
+   * @param string $default_media default @media to add to selectors without any @media
+   * @access private
+   * @version 1.0
+   */
+  function _convert_raw_css($default_media = &#039;&#039;) {
+    $this-&gt;tokens = array();
+
+    foreach ($this-&gt;css as $medium =&gt; $val) {
+      if ($this-&gt;parser-&gt;get_cfg(&#039;sort_selectors&#039;)) {
+        ksort($val);
+      }
+      if (intval($medium) &lt; DEFAULT_AT) {
+        $this-&gt;parser-&gt;_add_token(AT_START, $medium, true);
+      }
+      elseif ($default_media) {
+        $this-&gt;parser-&gt;_add_token(AT_START, $default_media, true);
+      }
+
+      foreach ($val as $selector =&gt; $vali) {
+        if ($this-&gt;parser-&gt;get_cfg(&#039;sort_properties&#039;)) {
+          ksort($vali);
+        }
+        $this-&gt;parser-&gt;_add_token(SEL_START, $selector, true);
+
+        foreach ($vali as $property =&gt; $valj) {
+          $this-&gt;parser-&gt;_add_token(PROPERTY, $property, true);
+          $this-&gt;parser-&gt;_add_token(VALUE, $valj, true);
+        }
+
+        $this-&gt;parser-&gt;_add_token(SEL_END, $selector, true);
+      }
+
+      if (intval($medium) &lt; DEFAULT_AT) {
+        $this-&gt;parser-&gt;_add_token(AT_END, $medium, true);
+      }
+      elseif ($default_media) {
+        $this-&gt;parser-&gt;_add_token(AT_END, $default_media, true);
+      }
+    }
+  }
+
+  /**
+   * Same as htmlspecialchars, only that chars are not replaced if $plain !== true. This makes  print_code() cleaner.
+   * @param string $string
+   * @param bool $plain
+   * @return string
+   * @see csstidy_print::_print()
+   * @access private
+   * @version 1.0
+   */
+  function _htmlsp($string, $plain) {
+    if (!$plain) {
+      return htmlspecialchars($string, ENT_QUOTES, &#039;utf-8&#039;);
+    }
+    return $string;
+  }
+
+  /**
+   * Get compression ratio
+   * @access public
+   * @return float
+   * @version 1.2
+   */
+  function get_ratio() {
+    if (!$this-&gt;output_css_plain) {
+      $this-&gt;formatted();
+    }
+    return round((strlen($this-&gt;input_css) - strlen($this-&gt;output_css_plain)) / strlen($this-&gt;input_css), 3) * 100;
+  }
+
+  /**
+   * Get difference between the old and new code in bytes and prints the code if necessary.
+   * @access public
+   * @return string
+   * @version 1.1
+   */
+  function get_diff() {
+    if (!$this-&gt;output_css_plain) {
+      $this-&gt;formatted();
+    }
+
+    $diff = strlen($this-&gt;output_css_plain) - strlen($this-&gt;input_css);
+
+    if ($diff &gt; 0) {
+      return &#039;+&#039; . $diff;
+    }
+    elseif ($diff == 0) {
+      return &#039;+-&#039; . $diff;
+    }
+
+    return $diff;
+  }
+
+  /**
+   * Get the size of either input or output CSS in KB
+   * @param string $loc default is &quot;output&quot;
+   * @access public
+   * @return integer
+   * @version 1.0
+   */
+  function size($loc = &#039;output&#039;) {
+    if ($loc === &#039;output&#039; &amp;&amp; !$this-&gt;output_css) {
+      $this-&gt;formatted();
+    }
+
+    if ($loc === &#039;input&#039;) {
+      return (strlen($this-&gt;input_css) / 1000);
+    }
+    else {
+      return (strlen($this-&gt;output_css_plain) / 1000);
+    }
+  }
 
 }
diff -up -r advagg_css_compress/csstidy/data.inc advagg_css_compress/csstidy/data.inc
--- advagg_css_compress/csstidy/data.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_css_compress/csstidy/data.inc	2012-03-23 13:02:22.000000000 -0600
@@ -24,13 +24,13 @@
  * @author Nikolay Matsievsky (speed at webo dot name) 2010
  */
 
-define(&#039;AT_START&#039;,    1);
-define(&#039;AT_END&#039;,      2);
-define(&#039;SEL_START&#039;,   3);
-define(&#039;SEL_END&#039;,     4);
-define(&#039;PROPERTY&#039;,    5);
-define(&#039;VALUE&#039;,       6);
-define(&#039;COMMENT&#039;,     7);
+define(&#039;AT_START&#039;,     1);
+define(&#039;AT_END&#039;,       2);
+define(&#039;SEL_START&#039;,    3);
+define(&#039;SEL_END&#039;,      4);
+define(&#039;PROPERTY&#039;,     5);
+define(&#039;VALUE&#039;,        6);
+define(&#039;COMMENT&#039;,      7);
 define(&#039;DEFAULT_AT&#039;, 41);
 
 /**
@@ -39,7 +39,7 @@ define(&#039;DEFAULT_AT&#039;, 41);
  * @global array $GLOBALS[&#039;csstidy&#039;][&#039;whitespace&#039;]
  * @version 1.0
  */
-$GLOBALS[&#039;csstidy&#039;][&#039;whitespace&#039;] = array(&#039; &#039;,&quot;\n&quot;,&quot;\t&quot;,&quot;\r&quot;,&quot;\x0B&quot;);
+$GLOBALS[&#039;csstidy&#039;][&#039;whitespace&#039;] = array(&#039; &#039;, &quot;\n&quot;, &quot;\t&quot;, &quot;\r&quot;, &quot;\x0B&quot;);
 
 /**
  * All CSS tokens used by csstidy
@@ -56,7 +56,7 @@ $GLOBALS[&#039;csstidy&#039;][&#039;tokens&#039;] = &#039;/@}{;:=
  * @global array $GLOBALS[&#039;csstidy&#039;][&#039;units&#039;]
  * @version 1.0
  */
-$GLOBALS[&#039;csstidy&#039;][&#039;units&#039;] = array(&#039;in&#039;,&#039;cm&#039;,&#039;mm&#039;,&#039;pt&#039;,&#039;pc&#039;,&#039;px&#039;,&#039;rem&#039;,&#039;em&#039;,&#039;%&#039;,&#039;ex&#039;,&#039;gd&#039;,&#039;vw&#039;,&#039;vh&#039;,&#039;vm&#039;,&#039;deg&#039;,&#039;grad&#039;,&#039;rad&#039;,&#039;ms&#039;,&#039;s&#039;,&#039;khz&#039;,&#039;hz&#039;);
+$GLOBALS[&#039;csstidy&#039;][&#039;units&#039;] = array(&#039;in&#039;, &#039;cm&#039;, &#039;mm&#039;, &#039;pt&#039;, &#039;pc&#039;, &#039;px&#039;, &#039;rem&#039;, &#039;em&#039;, &#039;%&#039;, &#039;ex&#039;, &#039;gd&#039;, &#039;vw&#039;, &#039;vh&#039;, &#039;vm&#039;, &#039;deg&#039;, &#039;grad&#039;, &#039;rad&#039;, &#039;ms&#039;, &#039;s&#039;, &#039;khz&#039;, &#039;hz&#039;);
 
 /**
  * Available at-rules
@@ -64,9 +64,16 @@ $GLOBALS[&#039;csstidy&#039;][&#039;units&#039;] = array(&#039;in
  * @global array $GLOBALS[&#039;csstidy&#039;][&#039;at_rules&#039;]
  * @version 1.0
  */
-$GLOBALS[&#039;csstidy&#039;][&#039;at_rules&#039;] = array(&#039;page&#039; =&gt; &#039;is&#039;,&#039;font-face&#039; =&gt; &#039;is&#039;,&#039;charset&#039; =&gt; &#039;iv&#039;, &#039;import&#039; =&gt; &#039;iv&#039;,&#039;namespace&#039; =&gt; &#039;iv&#039;,&#039;media&#039; =&gt; &#039;at&#039;);
+$GLOBALS[&#039;csstidy&#039;][&#039;at_rules&#039;] = array(
+  &#039;page&#039; =&gt; &#039;is&#039;,
+  &#039;font-face&#039; =&gt; &#039;is&#039;,
+  &#039;charset&#039; =&gt; &#039;iv&#039;,
+  &#039;import&#039; =&gt; &#039;iv&#039;,
+  &#039;namespace&#039; =&gt; &#039;iv&#039;,
+  &#039;media&#039; =&gt; &#039;at&#039;,
+);
 
- /**
+/**
  * Properties that need a value with unit
  *
  * @todo CSS3 properties
@@ -74,11 +81,47 @@ $GLOBALS[&#039;csstidy&#039;][&#039;at_rules&#039;] = array(
  * @global array $GLOBALS[&#039;csstidy&#039;][&#039;unit_values&#039;]
  * @version 1.2
  */
-$GLOBALS[&#039;csstidy&#039;][&#039;unit_values&#039;] = array (&#039;background&#039;, &#039;background-position&#039;, &#039;border&#039;, &#039;border-top&#039;, &#039;border-right&#039;, &#039;border-bottom&#039;, &#039;border-left&#039;, &#039;border-width&#039;,
-                                            &#039;border-top-width&#039;, &#039;border-right-width&#039;, &#039;border-left-width&#039;, &#039;border-bottom-width&#039;, &#039;bottom&#039;, &#039;border-spacing&#039;,
-											&#039;font-size&#039;, &#039;height&#039;, &#039;left&#039;, &#039;margin&#039;, &#039;margin-top&#039;, &#039;margin-right&#039;, &#039;margin-bottom&#039;, &#039;margin-left&#039;, &#039;max-height&#039;,
-											&#039;max-width&#039;, &#039;min-height&#039;, &#039;min-width&#039;, &#039;outline&#039;, &#039;outline-width&#039;, &#039;padding&#039;, &#039;padding-top&#039;, &#039;padding-right&#039;,
-											&#039;padding-bottom&#039;, &#039;padding-left&#039;, &#039;right&#039;, &#039;top&#039;, &#039;text-indent&#039;, &#039;letter-spacing&#039;, &#039;word-spacing&#039;, &#039;width&#039;);
+$GLOBALS[&#039;csstidy&#039;][&#039;unit_values&#039;] = array(
+  &#039;background&#039;,
+  &#039;background-position&#039;,
+  &#039;border&#039;,
+  &#039;border-top&#039;,
+  &#039;border-right&#039;,
+  &#039;border-bottom&#039;,
+  &#039;border-left&#039;,
+  &#039;border-width&#039;,
+  &#039;border-top-width&#039;,
+  &#039;border-right-width&#039;,
+  &#039;border-left-width&#039;,
+  &#039;border-bottom-width&#039;,
+  &#039;bottom&#039;,
+  &#039;border-spacing&#039;,
+  &#039;font-size&#039;,
+  &#039;height&#039;,
+  &#039;left&#039;,
+  &#039;margin&#039;,
+  &#039;margin-top&#039;,
+  &#039;margin-right&#039;,
+  &#039;margin-bottom&#039;,
+  &#039;margin-left&#039;,
+  &#039;max-height&#039;,
+  &#039;max-width&#039;,
+  &#039;min-height&#039;,
+  &#039;min-width&#039;,
+  &#039;outline&#039;,
+  &#039;outline-width&#039;,
+  &#039;padding&#039;,
+  &#039;padding-top&#039;,
+  &#039;padding-right&#039;,
+  &#039;padding-bottom&#039;,
+  &#039;padding-left&#039;,
+  &#039;right&#039;,
+  &#039;top&#039;,
+  &#039;text-indent&#039;,
+  &#039;letter-spacing&#039;,
+  &#039;word-spacing&#039;,
+  &#039;width&#039;,
+);
 
 /**
  * Properties that allow &lt;color&gt; as value
@@ -277,11 +320,11 @@ $GLOBALS[&#039;csstidy&#039;][&#039;replace_colors&#039;][&#039;y
  * @version 1.0
  */
 $GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;] = array();
-$GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;][&#039;border-color&#039;] = array(&#039;border-top-color&#039;,&#039;border-right-color&#039;,&#039;border-bottom-color&#039;,&#039;border-left-color&#039;);
-$GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;][&#039;border-style&#039;] = array(&#039;border-top-style&#039;,&#039;border-right-style&#039;,&#039;border-bottom-style&#039;,&#039;border-left-style&#039;);
-$GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;][&#039;border-width&#039;] = array(&#039;border-top-width&#039;,&#039;border-right-width&#039;,&#039;border-bottom-width&#039;,&#039;border-left-width&#039;);
-$GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;][&#039;margin&#039;] = array(&#039;margin-top&#039;,&#039;margin-right&#039;,&#039;margin-bottom&#039;,&#039;margin-left&#039;);
-$GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;][&#039;padding&#039;] = array(&#039;padding-top&#039;,&#039;padding-right&#039;,&#039;padding-bottom&#039;,&#039;padding-left&#039;);
+$GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;][&#039;border-color&#039;] = array(&#039;border-top-color&#039;, &#039;border-right-color&#039;, &#039;border-bottom-color&#039;, &#039;border-left-color&#039;);
+$GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;][&#039;border-style&#039;] = array(&#039;border-top-style&#039;, &#039;border-right-style&#039;, &#039;border-bottom-style&#039;, &#039;border-left-style&#039;);
+$GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;][&#039;border-width&#039;] = array(&#039;border-top-width&#039;, &#039;border-right-width&#039;, &#039;border-bottom-width&#039;, &#039;border-left-width&#039;);
+$GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;][&#039;margin&#039;] = array(&#039;margin-top&#039;, &#039;margin-right&#039;, &#039;margin-bottom&#039;, &#039;margin-left&#039;);
+$GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;][&#039;padding&#039;] = array(&#039;padding-top&#039;, &#039;padding-right&#039;, &#039;padding-bottom&#039;, &#039;padding-left&#039;);
 $GLOBALS[&#039;csstidy&#039;][&#039;shorthands&#039;][&#039;-moz-border-radius&#039;] = 0;
 
 /**
@@ -425,22 +468,22 @@ $GLOBALS[&#039;csstidy&#039;][&#039;all_properties&#039;][&#039;s
  * @see csstidy::load_template()
  */
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&lt;span class=&quot;at&quot;&gt;&#039;; //string before @rule
-$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&lt;/span&gt; &lt;span class=&quot;format&quot;&gt;{&lt;/span&gt;&#039;.&quot;\n&quot;; //bracket after @-rule
+$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&lt;/span&gt; &lt;span class=&quot;format&quot;&gt;{&lt;/span&gt;&#039; . &quot;\n&quot;; //bracket after @-rule
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&lt;span class=&quot;selector&quot;&gt;&#039;; //string before selector
-$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&lt;/span&gt; &lt;span class=&quot;format&quot;&gt;{&lt;/span&gt;&#039;.&quot;\n&quot;; //bracket after selector
+$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&lt;/span&gt; &lt;span class=&quot;format&quot;&gt;{&lt;/span&gt;&#039; . &quot;\n&quot;; //bracket after selector
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&lt;span class=&quot;property&quot;&gt;&#039;; //string before property
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&lt;/span&gt;&lt;span class=&quot;value&quot;&gt;&#039;; //string after property+before value
-$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&lt;/span&gt;&lt;span class=&quot;format&quot;&gt;;&lt;/span&gt;&#039;.&quot;\n&quot;; //string after value
+$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&lt;/span&gt;&lt;span class=&quot;format&quot;&gt;;&lt;/span&gt;&#039; . &quot;\n&quot;; //string after value
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&lt;span class=&quot;format&quot;&gt;}&lt;/span&gt;&#039;; //closing bracket - selector
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &quot;\n\n&quot;; //space between blocks {...}
-$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &quot;\n&quot;.&#039;&lt;span class=&quot;format&quot;&gt;}&lt;/span&gt;&#039;. &quot;\n\n&quot;; //closing bracket @-rule
+$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &quot;\n&quot; . &#039;&lt;span class=&quot;format&quot;&gt;}&lt;/span&gt;&#039; . &quot;\n\n&quot;; //closing bracket @-rule
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&#039;; //indent in @-rule
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&lt;span class=&quot;comment&quot;&gt;&#039;; // before comment
-$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&lt;/span&gt;&#039;.&quot;\n&quot;; // after comment
+$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &#039;&lt;/span&gt;&#039; . &quot;\n&quot;; // after comment
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;default&#039;][] = &quot;\n&quot;; // after last line @-rule
 
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;high_compression&#039;][] = &#039;&lt;span class=&quot;at&quot;&gt;&#039;;
-$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;high_compression&#039;][] = &#039;&lt;/span&gt; &lt;span class=&quot;format&quot;&gt;{&lt;/span&gt;&#039;.&quot;\n&quot;;
+$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;high_compression&#039;][] = &#039;&lt;/span&gt; &lt;span class=&quot;format&quot;&gt;{&lt;/span&gt;&#039; . &quot;\n&quot;;
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;high_compression&#039;][] = &#039;&lt;span class=&quot;selector&quot;&gt;&#039;;
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;high_compression&#039;][] = &#039;&lt;/span&gt;&lt;span class=&quot;format&quot;&gt;{&lt;/span&gt;&#039;;
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;high_compression&#039;][] = &#039;&lt;span class=&quot;property&quot;&gt;&#039;;
@@ -448,7 +491,7 @@ $GLOBALS[&#039;csstidy&#039;][&#039;predefined_template
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;high_compression&#039;][] = &#039;&lt;/span&gt;&lt;span class=&quot;format&quot;&gt;;&lt;/span&gt;&#039;;
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;high_compression&#039;][] = &#039;&lt;span class=&quot;format&quot;&gt;}&lt;/span&gt;&#039;;
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;high_compression&#039;][] = &quot;\n&quot;;
-$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;high_compression&#039;][] = &quot;\n&quot;. &#039;&lt;span class=&quot;format&quot;&gt;}&#039;.&quot;\n&quot;.&#039;&lt;/span&gt;&#039;;
+$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;high_compression&#039;][] = &quot;\n&quot; . &#039;&lt;span class=&quot;format&quot;&gt;}&#039; . &quot;\n&quot; . &#039;&lt;/span&gt;&#039;;
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;high_compression&#039;][] = &#039;&#039;;
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;high_compression&#039;][] = &#039;&lt;span class=&quot;comment&quot;&gt;&#039;; // before comment
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;high_compression&#039;][] = &#039;&lt;/span&gt;&#039;; // after comment
@@ -470,16 +513,16 @@ $GLOBALS[&#039;csstidy&#039;][&#039;predefined_template
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;highest_compression&#039;][] = &#039;&#039;;
 
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;&lt;span class=&quot;at&quot;&gt;&#039;;
-$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;&lt;/span&gt; &lt;span class=&quot;format&quot;&gt;{&lt;/span&gt;&#039;.&quot;\n&quot;;
+$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;&lt;/span&gt; &lt;span class=&quot;format&quot;&gt;{&lt;/span&gt;&#039; . &quot;\n&quot;;
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;&lt;span class=&quot;selector&quot;&gt;&#039;;
-$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;&lt;/span&gt;&#039;.&quot;\n&quot;.&#039;&lt;span class=&quot;format&quot;&gt;{&lt;/span&gt;&#039;.&quot;\n&quot;;
+$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;&lt;/span&gt;&#039; . &quot;\n&quot; . &#039;&lt;span class=&quot;format&quot;&gt;{&lt;/span&gt;&#039; . &quot;\n&quot;;
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;	&lt;span class=&quot;property&quot;&gt;&#039;;
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;&lt;/span&gt;&lt;span class=&quot;value&quot;&gt;&#039;;
-$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;&lt;/span&gt;&lt;span class=&quot;format&quot;&gt;;&lt;/span&gt;&#039;.&quot;\n&quot;;
+$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;&lt;/span&gt;&lt;span class=&quot;format&quot;&gt;;&lt;/span&gt;&#039; . &quot;\n&quot;;
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;&lt;span class=&quot;format&quot;&gt;}&lt;/span&gt;&#039;;
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &quot;\n\n&quot;;
-$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &quot;\n&quot;.&#039;&lt;span class=&quot;format&quot;&gt;}&lt;/span&gt;&#039;.&quot;\n\n&quot;;
+$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &quot;\n&quot; . &#039;&lt;span class=&quot;format&quot;&gt;}&lt;/span&gt;&#039; . &quot;\n\n&quot;;
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;	&#039;;
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;&lt;span class=&quot;comment&quot;&gt;&#039;; // before comment
-$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;&lt;/span&gt;&#039;.&quot;\n&quot;; // after comment
+$GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &#039;&lt;/span&gt;&#039; . &quot;\n&quot;; // after comment
 $GLOBALS[&#039;csstidy&#039;][&#039;predefined_templates&#039;][&#039;low_compression&#039;][] = &quot;\n&quot;;
diff -up -r advagg_js_cdn/advagg_js_cdn.module advagg_js_cdn/advagg_js_cdn.module
--- advagg_js_cdn/advagg_js_cdn.module	2012-03-23 12:08:13.000000000 -0600
+++ advagg_js_cdn/advagg_js_cdn.module	2012-03-23 13:02:22.000000000 -0600
@@ -30,8 +30,8 @@ function advagg_js_cdn_advagg_js_pre_alt
   $cdn_jquery_ui = variable_get(&#039;advagg_js_cdn_jquery_ui&#039;, ADVAGG_JS_CDN_JQUERY_UI);
   $cdn_swfobject = variable_get(&#039;advagg_js_cdn_swfobject&#039;, ADVAGG_JS_CDN_SWFOBJECT);
   if (   !$cdn_jquery
-      &amp;&amp; !$cdn_jquery_ui
-      &amp;&amp; !$cdn_swfobject
+       &amp;&amp; !$cdn_jquery_ui
+       &amp;&amp; !$cdn_swfobject
         ) {
     return FALSE;
   }
@@ -96,11 +96,11 @@ function advagg_js_cdn_advagg_js_pre_alt
       // jquery-ui.js
       if ($cdn_jquery_ui) {
         if (   isset($jquery_ui_filepath)
-            &amp;&amp; isset($jquery_ui_version)
-            &amp;&amp; $path == $jquery_ui_filepath
+             &amp;&amp; isset($jquery_ui_version)
+             &amp;&amp; $path == $jquery_ui_filepath
               ) {
           $info[&#039;preprocess&#039;] = FALSE;
-          $javascript[&#039;external&#039;][$schema . &#039;://ajax.googleapis.com/ajax/libs/jqueryui/&#039; . $jquery_ui_version .&#039;/jquery-ui.min.js&#039;] = $info;
+          $javascript[&#039;external&#039;][$schema . &#039;://ajax.googleapis.com/ajax/libs/jqueryui/&#039; . $jquery_ui_version . &#039;/jquery-ui.min.js&#039;] = $info;
           unset($javascript[$type][$path]);
         }
       }
@@ -108,10 +108,10 @@ function advagg_js_cdn_advagg_js_pre_alt
       // swfobject.js
       if ($cdn_swfobject) {
         if (   isset($swfobject_filepath)
-            &amp;&amp; $path == $swfobject_filepath
+             &amp;&amp; $path == $swfobject_filepath
               ) {
           $info[&#039;preprocess&#039;] = FALSE;
-          $javascript[&#039;external&#039;][$schema . &#039;://ajax.googleapis.com/ajax/libs/swfobject/&#039; . $swfobject_version .&#039;/swfobject.js&#039;] = $info;
+          $javascript[&#039;external&#039;][$schema . &#039;://ajax.googleapis.com/ajax/libs/swfobject/&#039; . $swfobject_version . &#039;/swfobject.js&#039;] = $info;
           unset($javascript[$type][$path]);
         }
       }
diff -up -r advagg_js_compress/advagg_js_compress.admin.inc advagg_js_compress/advagg_js_compress.admin.inc
--- advagg_js_compress/advagg_js_compress.admin.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_js_compress/advagg_js_compress.admin.inc	2012-03-23 13:02:22.000000000 -0600
@@ -23,14 +23,14 @@ function advagg_js_compress_admin_settin
   $form = array();
 
   $form[&#039;advagg_js_compress_agg_files&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Compress JS Files&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_js_compress_agg_files&#039;, ADVAGG_JS_COMPRESS_AGG_FILES),
+    &#039;#type&#039; =&gt; &#039;checkbox&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Compress JS Files&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_js_compress_agg_files&#039;, ADVAGG_JS_COMPRESS_AGG_FILES),
   );
   $form[&#039;advagg_js_compress_inline&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Compress Inline JS&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_js_compress_inline&#039;, ADVAGG_JS_COMPRESS_INLINE),
+    &#039;#type&#039; =&gt; &#039;checkbox&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Compress Inline JS&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_js_compress_inline&#039;, ADVAGG_JS_COMPRESS_INLINE),
   );
 
   $description = &#039;&#039;;
@@ -43,18 +43,18 @@ function advagg_js_compress_admin_settin
     $description .= t(&#039;You can use the much faster C version of JSMin by installing the &lt;a href=&quot;@php_jsmin&quot;&gt;JSMin PHP Extension&lt;/a&gt; on this server.&#039;, array(&#039;@php_jsmin&#039; =&gt; &#039;http://www.ypass.net/software/php_jsmin/&#039;));
   }
   $form[&#039;advagg_js_compressor&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;radios&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Select the compression program to use&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_js_compressor&#039;, ADVAGG_JS_COMPRESSOR),
-    &#039;#options&#039;        =&gt; $options,
-    &#039;#description&#039;    =&gt; filter_xss($description),
+    &#039;#type&#039; =&gt; &#039;radios&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Select the compression program to use&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_js_compressor&#039;, ADVAGG_JS_COMPRESSOR),
+    &#039;#options&#039; =&gt; $options,
+    &#039;#description&#039; =&gt; filter_xss($description),
   );
 
   $form[&#039;advagg_js_compress_packer_enable&#039;] = array(
-    &#039;#type&#039;           =&gt; &#039;checkbox&#039;,
-    &#039;#title&#039;          =&gt; t(&#039;Enable Packer&#039;),
-    &#039;#default_value&#039;  =&gt; variable_get(&#039;advagg_js_compress_packer_enable&#039;, ADVAGG_JS_COMPRESS_PACKER_ENABLE),
-    &#039;#description&#039;    =&gt; t(&#039;If enabled the non gzip version of JS files will be compressed using the JS Packer. WARNING: This has a high chance of breaking your JS. Only Enable on production after testing the non gzipped version locally.&#039;),
+    &#039;#type&#039; =&gt; &#039;checkbox&#039;,
+    &#039;#title&#039; =&gt; t(&#039;Enable Packer&#039;),
+    &#039;#default_value&#039; =&gt; variable_get(&#039;advagg_js_compress_packer_enable&#039;, ADVAGG_JS_COMPRESS_PACKER_ENABLE),
+    &#039;#description&#039; =&gt; t(&#039;If enabled the non gzip version of JS files will be compressed using the JS Packer. WARNING: This has a high chance of breaking your JS. Only Enable on production after testing the non gzipped version locally.&#039;),
   );
 
   return system_settings_form($form);
diff -up -r advagg_js_compress/advagg_js_compress.install advagg_js_compress/advagg_js_compress.install
--- advagg_js_compress/advagg_js_compress.install	2012-03-23 12:08:13.000000000 -0600
+++ advagg_js_compress/advagg_js_compress.install	2012-03-23 13:02:22.000000000 -0600
@@ -72,9 +72,9 @@ function advagg_js_compress_requirements
     $advagg_js_compress_callback = variable_get(&#039;advagg_js_compress_callback&#039;, ADVAGG_JS_COMPRESS_CALLBACK);
     if (is_array($compressible)) {
       $requirements[&#039;advagg_js_compress_callback&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;AdvAgg JS Compress - Callback&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
-        &#039;value&#039;       =&gt; $t(&#039;The callback for testing if a JS file is compressible is not working.&#039;),
+        &#039;title&#039; =&gt; $t(&#039;AdvAgg JS Compress - Callback&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
+        &#039;value&#039; =&gt; $t(&#039;The callback for testing if a JS file is compressible is not working.&#039;),
         &#039;description&#039; =&gt; $t(&#039;As a result if jsmin+ encounters a file that it cannot compress, it will kill that PHP process.&#039;),
       );
       if ($advagg_js_compress_callback != FALSE) {
@@ -83,9 +83,9 @@ function advagg_js_compress_requirements
     }
     else {
       $requirements[&#039;advagg_js_compress_callback&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;AdvAgg JS Compress - Callback&#039;),
-        &#039;severity&#039;    =&gt; REQUIREMENT_OK,
-        &#039;value&#039;       =&gt; $t(&#039;The callback is working correctly.&#039;),
+        &#039;title&#039; =&gt; $t(&#039;AdvAgg JS Compress - Callback&#039;),
+        &#039;severity&#039; =&gt; REQUIREMENT_OK,
+        &#039;value&#039; =&gt; $t(&#039;The callback is working correctly.&#039;),
       );
       if ($advagg_js_compress_callback == FALSE) {
         variable_set(&#039;advagg_js_compress_callback&#039;, TRUE);
@@ -100,9 +100,9 @@ function advagg_js_compress_requirements
     // doesn&#039;t impose a limit on memory used by PHP scripts
     if ($compressor == 0 &amp;&amp; $memory_limit &amp;&amp; $memory_limit != -1 &amp;&amp; parse_size($memory_limit) &lt; parse_size(&#039;96M&#039;)) {
       $requirements[&#039;advagg_js_compress_memory_limit&#039;] = array(
-        &#039;title&#039;       =&gt; $t(&#039;AdvAgg JS Compress - Memory Limit&#039;),
-        &#039;value&#039;       =&gt; $memory_limit,
-        &#039;severity&#039;    =&gt; REQUIREMENT_WARNING,
+        &#039;title&#039; =&gt; $t(&#039;AdvAgg JS Compress - Memory Limit&#039;),
+        &#039;value&#039; =&gt; $memory_limit,
+        &#039;severity&#039; =&gt; REQUIREMENT_WARNING,
         &#039;description&#039; =&gt; $t(&#039;It is highly recommended that you set your PHP memory_limit at least 96M if you are going to use JSMin+.&#039;),
       );
     }
@@ -146,7 +146,10 @@ function advagg_js_compress_update_6100(
   $ret = array();
 
   cache_clear_all(&#039;*&#039;, &#039;cache_advagg_files_data&#039;, TRUE);
-  $ret[] = array(&#039;success&#039; =&gt; TRUE, &#039;query&#039; =&gt; &#039;advagg files_data cache flushed.&#039;);
+  $ret[] = array(
+    &#039;success&#039; =&gt; TRUE,
+    &#039;query&#039; =&gt; &#039;advagg files_data cache flushed.&#039;,
+  );
 
   return $ret;
 }
@@ -185,7 +188,10 @@ function advagg_js_compress_update_6103(
 
   // Clear cache_advagg_js_compress_file cache.
   cache_clear_all(&#039;*&#039;, &#039;cache_advagg_js_compress_file&#039;, TRUE);
-  $ret[] = array(&#039;success&#039; =&gt; TRUE, &#039;query&#039; =&gt; &#039;The cache_advagg_js_compress_file table has been cleared.&#039;);
+  $ret[] = array(
+    &#039;success&#039; =&gt; TRUE,
+    &#039;query&#039; =&gt; &#039;The cache_advagg_js_compress_file table has been cleared.&#039;,
+  );
 
   return $ret;
 }
diff -up -r advagg_js_compress/advagg_js_compress.module advagg_js_compress/advagg_js_compress.module
--- advagg_js_compress/advagg_js_compress.module	2012-03-23 12:08:13.000000000 -0600
+++ advagg_js_compress/advagg_js_compress.module	2012-03-23 13:02:22.000000000 -0600
@@ -162,7 +162,7 @@ function advagg_js_compress_advagg_js_in
     $original_contents = $contents;
 
     list($before, $after) = advagg_js_compress_jsminplus($contents);
-    $ratio = ($before - $after)/$before;
+    $ratio = ($before - $after) / $before;
     // Make sure the returned string is not empty or has a VERY high
     // compression ratio.
     if (empty($contents) || $ratio &gt; variable_get(&#039;advagg_js_max_compress_ratio&#039;, ADVAGG_JS_MAX_COMPRESS_RATIO)) {
@@ -247,7 +247,7 @@ function advagg_js_compress_prep(&amp;$conte
         $compressor = variable_get(&#039;advagg_js_compressor&#039;, ADVAGG_JS_COMPRESSOR);
         if ($compressor == 0) {
           list($before, $after) = advagg_js_compress_jsminplus($data);
-          $ratio = ($before - $after)/$before;
+          $ratio = ($before - $after) / $before;
           // Make sure the returned string is not empty or has a VERY high
           // compression ratio.
           if (empty($data) || $ratio &gt; variable_get(&#039;advagg_js_max_compress_ratio&#039;, ADVAGG_JS_MAX_COMPRESS_RATIO)) {
@@ -282,7 +282,7 @@ function advagg_js_compress_jsminplus(&amp;$
   }
 
   // JSMin+ the contents of the aggregated file.
-  require_once(drupal_get_path(&#039;module&#039;, &#039;advagg_js_compress&#039;) .&#039;/jsminplus.inc&#039;);
+  require_once(drupal_get_path(&#039;module&#039;, &#039;advagg_js_compress&#039;) . &#039;/jsminplus.inc&#039;);
   // Strip Byte Order Marks (BOM&#039;s) from the file, JSMin+ cannot parse these.
   $before = strlen($contents);
   $original_contents = $contents;
@@ -429,7 +429,7 @@ function advagg_js_compress_test_file($v
     list($before, $after) = advagg_js_compress_jsminplus($contents);
 
     // Set to &quot;-2&quot; if compression ratio sucks.
-    $ratio = ($before - $after)/$before;
+    $ratio = ($before - $after) / $before;
     if ($ratio &lt; variable_get(&#039;advagg_js_compress_ratio&#039;, ADVAGG_JS_COMPRESS_RATIO)) {
       $data[&#039;advagg_js_compress&#039;][&#039;tested&#039;][&#039;jsminplus&#039;] = -2;
       advagg_set_file_data($md5, $data);
@@ -551,7 +551,7 @@ function advagg_js_compress_file_saver($
  */
 function advagg_js_compress_jspacker(&amp;$contents) {
   // Use Packer on the contents of the aggregated file.
-  require_once(drupal_get_path(&#039;module&#039;, &#039;advagg_js_compress&#039;) .&#039;/jspacker.inc&#039;);
+  require_once(drupal_get_path(&#039;module&#039;, &#039;advagg_js_compress&#039;) . &#039;/jspacker.inc&#039;);
 
   // Add semicolons to the end of lines if missing.
   $contents = str_replace(&quot;}\n&quot;, &quot;};\n&quot;, $contents);
diff -up -r advagg_js_compress/jsminplus.inc advagg_js_compress/jsminplus.inc
--- advagg_js_compress/jsminplus.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_js_compress/jsminplus.inc	2012-03-23 13:02:23.000000000 -0600
@@ -171,1916 +171,2088 @@ define(&#039;KEYWORD_WHILE&#039;, &#039;while&#039;);
 define(&#039;KEYWORD_WITH&#039;, &#039;with&#039;);
 
 
-class JSMinPlus
-{
-	private $parser;
-	private $reserved = array(
-		&#039;break&#039;, &#039;case&#039;, &#039;catch&#039;, &#039;continue&#039;, &#039;default&#039;, &#039;delete&#039;, &#039;do&#039;,
-		&#039;else&#039;, &#039;finally&#039;, &#039;for&#039;, &#039;function&#039;, &#039;if&#039;, &#039;in&#039;, &#039;instanceof&#039;,
-		&#039;new&#039;, &#039;return&#039;, &#039;switch&#039;, &#039;this&#039;, &#039;throw&#039;, &#039;try&#039;, &#039;typeof&#039;, &#039;var&#039;,
-		&#039;void&#039;, &#039;while&#039;, &#039;with&#039;,
-		// Words reserved for future use
-		&#039;abstract&#039;, &#039;boolean&#039;, &#039;byte&#039;, &#039;char&#039;, &#039;class&#039;, &#039;const&#039;, &#039;debugger&#039;,
-		&#039;double&#039;, &#039;enum&#039;, &#039;export&#039;, &#039;extends&#039;, &#039;final&#039;, &#039;float&#039;, &#039;goto&#039;,
-		&#039;implements&#039;, &#039;import&#039;, &#039;int&#039;, &#039;interface&#039;, &#039;long&#039;, &#039;native&#039;,
-		&#039;package&#039;, &#039;private&#039;, &#039;protected&#039;, &#039;public&#039;, &#039;short&#039;, &#039;static&#039;,
-		&#039;super&#039;, &#039;synchronized&#039;, &#039;throws&#039;, &#039;transient&#039;, &#039;volatile&#039;,
-		// These are not reserved, but should be taken into account
-		// in isValidIdentifier (See jslint source code)
-		&#039;arguments&#039;, &#039;eval&#039;, &#039;true&#039;, &#039;false&#039;, &#039;Infinity&#039;, &#039;NaN&#039;, &#039;null&#039;, &#039;undefined&#039;
-	);
-
-	private function __construct()
-	{
-		$this-&gt;parser = new JSParser($this);
-	}
-
-	public static function minify($js, $filename=&#039;&#039;)
-	{
-		static $instance;
-
-		// this is a singleton
-		if(!$instance)
-			$instance = new JSMinPlus();
-
-		return $instance-&gt;min($js, $filename);
-	}
-
-	private function min($js, $filename)
-	{
-		try
-		{
-			$n = $this-&gt;parser-&gt;parse($js, $filename, 1);
-			return $this-&gt;parseTree($n);
-		}
-		catch(Exception $e)
-		{
-			echo $e-&gt;getMessage() . &quot;\n&quot;;
-		}
-
-		return false;
-	}
-
-	public function parseTree($n, $noBlockGrouping = false)
-	{
-		$s = &#039;&#039;;
-
-		switch ($n-&gt;type)
-		{
-			case JS_MINIFIED:
-				$s = $n-&gt;value;
-			break;
-
-			case JS_SCRIPT:
-				// we do nothing yet with funDecls or varDecls
-				$noBlockGrouping = true;
-			// FALL THROUGH
-
-			case JS_BLOCK:
-				$childs = $n-&gt;treeNodes;
-				$lastType = 0;
-				for ($c = 0, $i = 0, $j = count($childs); $i &lt; $j; $i++)
-				{
-					$type = $childs[$i]-&gt;type;
-					$t = $this-&gt;parseTree($childs[$i]);
-					if (strlen($t))
-					{
-						if ($c)
-						{
-							$s = rtrim($s, &#039;;&#039;);
-
-							if ($type == KEYWORD_FUNCTION &amp;&amp; $childs[$i]-&gt;functionForm == DECLARED_FORM)
-							{
-								// put declared functions on a new line
-								$s .= &quot;\n&quot;;
-							}
-							elseif ($type == KEYWORD_VAR &amp;&amp; $type == $lastType)
-							{
-								// mutiple var-statements can go into one
-								$t = &#039;,&#039; . substr($t, 4);
-							}
-							else
-							{
-								// add terminator
-								$s .= &#039;;&#039;;
-							}
-						}
-
-						$s .= $t;
-
-						$c++;
-						$lastType = $type;
-					}
-				}
-
-				if ($c &gt; 1 &amp;&amp; !$noBlockGrouping)
-				{
-					$s = &#039;{&#039; . $s . &#039;}&#039;;
-				}
-			break;
-
-			case KEYWORD_FUNCTION:
-				$s .= &#039;function&#039; . ($n-&gt;name ? &#039; &#039; . $n-&gt;name : &#039;&#039;) . &#039;(&#039;;
-				$params = $n-&gt;params;
-				for ($i = 0, $j = count($params); $i &lt; $j; $i++)
-					$s .= ($i ? &#039;,&#039; : &#039;&#039;) . $params[$i];
-				$s .= &#039;){&#039; . $this-&gt;parseTree($n-&gt;body, true) . &#039;}&#039;;
-			break;
-
-			case KEYWORD_IF:
-				$s = &#039;if(&#039; . $this-&gt;parseTree($n-&gt;condition) . &#039;)&#039;;
-				$thenPart = $this-&gt;parseTree($n-&gt;thenPart);
-				$elsePart = $n-&gt;elsePart ? $this-&gt;parseTree($n-&gt;elsePart) : null;
-
-				// empty if-statement
-				if ($thenPart == &#039;&#039;)
-					$thenPart = &#039;;&#039;;
-
-				if ($elsePart)
-				{
-					// be carefull and always make a block out of the thenPart; could be more optimized but is a lot of trouble
-					if ($thenPart != &#039;;&#039; &amp;&amp; $thenPart[0] != &#039;{&#039;)
-						$thenPart = &#039;{&#039; . $thenPart . &#039;}&#039;;
-
-					$s .= $thenPart . &#039;else&#039;;
-
-					// we could check for more, but that hardly ever applies so go for performance
-					if ($elsePart[0] != &#039;{&#039;)
-						$s .= &#039; &#039;;
-
-					$s .= $elsePart;
-				}
-				else
-				{
-					$s .= $thenPart;
-				}
-			break;
-
-			case KEYWORD_SWITCH:
-				$s = &#039;switch(&#039; . $this-&gt;parseTree($n-&gt;discriminant) . &#039;){&#039;;
-				$cases = $n-&gt;cases;
-				for ($i = 0, $j = count($cases); $i &lt; $j; $i++)
-				{
-					$case = $cases[$i];
-					if ($case-&gt;type == KEYWORD_CASE)
-						$s .= &#039;case&#039; . ($case-&gt;caseLabel-&gt;type != TOKEN_STRING ? &#039; &#039; : &#039;&#039;) . $this-&gt;parseTree($case-&gt;caseLabel) . &#039;:&#039;;
-					else
-						$s .= &#039;default:&#039;;
-
-					$statement = $this-&gt;parseTree($case-&gt;statements, true);
-					if ($statement)
-					{
-						$s .= $statement;
-						// no terminator for last statement
-						if ($i + 1 &lt; $j)
-							$s .= &#039;;&#039;;
-					}
-				}
-				$s .= &#039;}&#039;;
-			break;
+class JSMinPlus {
+  private $parser;
+  private $reserved = array(
+    &#039;break&#039;,
+    &#039;case&#039;,
+    &#039;catch&#039;,
+    &#039;continue&#039;,
+    &#039;default&#039;,
+    &#039;delete&#039;,
+    &#039;do&#039;,
+    &#039;else&#039;,
+    &#039;finally&#039;,
+    &#039;for&#039;,
+    &#039;function&#039;,
+    &#039;if&#039;,
+    &#039;in&#039;,
+    &#039;instanceof&#039;,
+    &#039;new&#039;,
+    &#039;return&#039;,
+    &#039;switch&#039;,
+    &#039;this&#039;,
+    &#039;throw&#039;,
+    &#039;try&#039;,
+    &#039;typeof&#039;,
+    &#039;var&#039;,
+    &#039;void&#039;,
+    &#039;while&#039;,
+    &#039;with&#039;,
+    // Words reserved for future use
+    &#039;abstract&#039;,
+    &#039;boolean&#039;,
+    &#039;byte&#039;,
+    &#039;char&#039;,
+    &#039;class&#039;,
+    &#039;const&#039;,
+    &#039;debugger&#039;,
+    &#039;double&#039;,
+    &#039;enum&#039;,
+    &#039;export&#039;,
+    &#039;extends&#039;,
+    &#039;final&#039;,
+    &#039;float&#039;,
+    &#039;goto&#039;,
+    &#039;implements&#039;,
+    &#039;import&#039;,
+    &#039;int&#039;,
+    &#039;interface&#039;,
+    &#039;long&#039;,
+    &#039;native&#039;,
+    &#039;package&#039;,
+    &#039;private&#039;,
+    &#039;protected&#039;,
+    &#039;public&#039;,
+    &#039;short&#039;,
+    &#039;static&#039;,
+    &#039;super&#039;,
+    &#039;synchronized&#039;,
+    &#039;throws&#039;,
+    &#039;transient&#039;,
+    &#039;volatile&#039;,
+    // These are not reserved, but should be taken into account
+    // in isValidIdentifier (See jslint source code)
+    &#039;arguments&#039;,
+    &#039;eval&#039;,
+    &#039;true&#039;,
+    &#039;false&#039;,
+    &#039;Infinity&#039;,
+    &#039;NaN&#039;,
+    &#039;null&#039;,
+    &#039;undefined&#039;,
+  );
+
+  private function __construct() {
+    $this-&gt;parser = new JSParser($this);
+  }
+
+  public static function minify($js, $filename = &#039;&#039;) {
+    static $instance;
+
+    // this is a singleton
+    if (!$instance) {
+      $instance = new JSMinPlus();
+    }
+
+    return $instance-&gt;min($js, $filename);
+  }
+
+  private function min($js, $filename) {
+    try {
+      $n = $this-&gt;parser-&gt;parse($js, $filename, 1);
+      return $this-&gt;parseTree($n);
+    }
+    catch (Exception $e) {
+      echo $e-&gt;getMessage() . &quot;\n&quot;;
+    }
+
+    return false;
+  }
+
+  public function parseTree($n, $noBlockGrouping = false) {
+    $s = &#039;&#039;;
+
+    switch ($n-&gt;type) {
+      case JS_MINIFIED:
+        $s = $n-&gt;value;
+        break;
+
+      case JS_SCRIPT:
+        // we do nothing yet with funDecls or varDecls
+        $noBlockGrouping = true;
+        // FALL THROUGH
+
+      case JS_BLOCK:
+        $childs = $n-&gt;treeNodes;
+        $lastType = 0;
+        for ($c = 0, $i = 0, $j = count($childs); $i &lt; $j; $i++) {
+          $type = $childs[$i]-&gt;type;
+          $t = $this-&gt;parseTree($childs[$i]);
+          if (strlen($t)) {
+            if ($c) {
+              $s = rtrim($s, &#039;;&#039;);
+
+              if ($type == KEYWORD_FUNCTION &amp;&amp; $childs[$i]-&gt;functionForm == DECLARED_FORM) {
+                // put declared functions on a new line
+                $s .= &quot;\n&quot;;
+              }
+              elseif ($type == KEYWORD_VAR &amp;&amp; $type == $lastType) {
+                // mutiple var-statements can go into one
+                $t = &#039;,&#039; . substr($t, 4);
+              }
+              else {
+                // add terminator
+                $s .= &#039;;&#039;;
+              }
+            }
+
+            $s .= $t;
+
+            $c++;
+            $lastType = $type;
+          }
+        }
+
+        if ($c &gt; 1 &amp;&amp; !$noBlockGrouping) {
+          $s = &#039;{&#039; . $s . &#039;}&#039;;
+        }
+        break;
+
+      case KEYWORD_FUNCTION:
+        $s .= &#039;function&#039; . ($n-&gt;name ? &#039; &#039; . $n-&gt;name : &#039;&#039;) . &#039;(&#039;;
+        $params = $n-&gt;params;
+        for ($i = 0, $j = count($params); $i &lt; $j; $i++) {
+          $s .= ($i ? &#039;,&#039; : &#039;&#039;) . $params[$i];
+        }
+        $s .= &#039;){&#039; . $this-&gt;parseTree($n-&gt;body, true) . &#039;}&#039;;
+        break;
+
+      case KEYWORD_IF:
+        $s = &#039;if(&#039; . $this-&gt;parseTree($n-&gt;condition) . &#039;)&#039;;
+        $thenPart = $this-&gt;parseTree($n-&gt;thenPart);
+        $elsePart = $n-&gt;elsePart ? $this-&gt;parseTree($n-&gt;elsePart) : null;
+
+        // empty if-statement
+        if ($thenPart == &#039;&#039;) {
+          $thenPart = &#039;;&#039;;
+        }
+
+        if ($elsePart) {
+          // be carefull and always make a block out of the thenPart; could be more optimized but is a lot of trouble
+          if ($thenPart != &#039;;&#039; &amp;&amp; $thenPart[0] != &#039;{&#039;) {
+            $thenPart = &#039;{&#039; . $thenPart . &#039;}&#039;;
+          }
+
+          $s .= $thenPart . &#039;else&#039;;
+
+          // we could check for more, but that hardly ever applies so go for performance
+          if ($elsePart[0] != &#039;{&#039;) {
+            $s .= &#039; &#039;;
+          }
+
+          $s .= $elsePart;
+        }
+        else {
+          $s .= $thenPart;
+        }
+        break;
+
+      case KEYWORD_SWITCH:
+        $s = &#039;switch(&#039; . $this-&gt;parseTree($n-&gt;discriminant) . &#039;){&#039;;
+        $cases = $n-&gt;cases;
+        for ($i = 0, $j = count($cases); $i &lt; $j; $i++) {
+          $case = $cases[$i];
+          if ($case-&gt;type == KEYWORD_CASE) {
+            $s .= &#039;case&#039; . ($case-&gt;caseLabel-&gt;type != TOKEN_STRING ? &#039; &#039; : &#039;&#039;) . $this-&gt;parseTree($case-&gt;caseLabel) . &#039;:&#039;;
+          }
+          else {
+            $s .= &#039;default:&#039;;
+          }
+
+          $statement = $this-&gt;parseTree($case-&gt;statements, true);
+          if ($statement) {
+            $s .= $statement;
+            // no terminator for last statement
+            if ($i + 1 &lt; $j) {
+              $s .= &#039;;&#039;;
+            }
+          }
+        }
+        $s .= &#039;}&#039;;
+        break;
 
-			case KEYWORD_FOR:
-				$s = &#039;for(&#039; . ($n-&gt;setup ? $this-&gt;parseTree($n-&gt;setup) : &#039;&#039;)
+      case KEYWORD_FOR:
+        $s = &#039;for(&#039; . ($n-&gt;setup ? $this-&gt;parseTree($n-&gt;setup) : &#039;&#039;)
 					. &#039;;&#039; . ($n-&gt;condition ? $this-&gt;parseTree($n-&gt;condition) : &#039;&#039;)
 					. &#039;;&#039; . ($n-&gt;update ? $this-&gt;parseTree($n-&gt;update) : &#039;&#039;) . &#039;)&#039;;
 
-				$body  = $this-&gt;parseTree($n-&gt;body);
-				if ($body == &#039;&#039;)
-					$body = &#039;;&#039;;
-
-				$s .= $body;
-			break;
-
-			case KEYWORD_WHILE:
-				$s = &#039;while(&#039; . $this-&gt;parseTree($n-&gt;condition) . &#039;)&#039;;
-
-				$body  = $this-&gt;parseTree($n-&gt;body);
-				if ($body == &#039;&#039;)
-					$body = &#039;;&#039;;
-
-				$s .= $body;
-			break;
-
-			case JS_FOR_IN:
-				$s = &#039;for(&#039; . ($n-&gt;varDecl ? $this-&gt;parseTree($n-&gt;varDecl) : $this-&gt;parseTree($n-&gt;iterator)) . &#039; in &#039; . $this-&gt;parseTree($n-&gt;object) . &#039;)&#039;;
-
-				$body  = $this-&gt;parseTree($n-&gt;body);
-				if ($body == &#039;&#039;)
-					$body = &#039;;&#039;;
-
-				$s .= $body;
-			break;
-
-			case KEYWORD_DO:
-				$s = &#039;do{&#039; . $this-&gt;parseTree($n-&gt;body, true) . &#039;}while(&#039; . $this-&gt;parseTree($n-&gt;condition) . &#039;)&#039;;
-			break;
-
-			case KEYWORD_BREAK:
-			case KEYWORD_CONTINUE:
-				$s = $n-&gt;value . ($n-&gt;label ? &#039; &#039; . $n-&gt;label : &#039;&#039;);
-			break;
-
-			case KEYWORD_TRY:
-				$s = &#039;try{&#039; . $this-&gt;parseTree($n-&gt;tryBlock, true) . &#039;}&#039;;
-				$catchClauses = $n-&gt;catchClauses;
-				for ($i = 0, $j = count($catchClauses); $i &lt; $j; $i++)
-				{
-					$t = $catchClauses[$i];
-					$s .= &#039;catch(&#039; . $t-&gt;varName . ($t-&gt;guard ? &#039; if &#039; . $this-&gt;parseTree($t-&gt;guard) : &#039;&#039;) . &#039;){&#039; . $this-&gt;parseTree($t-&gt;block, true) . &#039;}&#039;;
-				}
-				if ($n-&gt;finallyBlock)
-					$s .= &#039;finally{&#039; . $this-&gt;parseTree($n-&gt;finallyBlock, true) . &#039;}&#039;;
-			break;
-
-			case KEYWORD_THROW:
-			case KEYWORD_RETURN:
-				$s = $n-&gt;type;
-				if ($n-&gt;value)
-				{
-					$t = $this-&gt;parseTree($n-&gt;value);
-					if (strlen($t))
-					{
-						if ($this-&gt;isWordChar($t[0]) || $t[0] == &#039;\\&#039;)
-							$s .= &#039; &#039;;
-
-						$s .= $t;
-					}
-				}
-			break;
-
-			case KEYWORD_WITH:
-				$s = &#039;with(&#039; . $this-&gt;parseTree($n-&gt;object) . &#039;)&#039; . $this-&gt;parseTree($n-&gt;body);
-			break;
-
-			case KEYWORD_VAR:
-			case KEYWORD_CONST:
-				$s = $n-&gt;value . &#039; &#039;;
-				$childs = $n-&gt;treeNodes;
-				for ($i = 0, $j = count($childs); $i &lt; $j; $i++)
-				{
-					$t = $childs[$i];
-					$s .= ($i ? &#039;,&#039; : &#039;&#039;) . $t-&gt;name;
-					$u = $t-&gt;initializer;
-					if ($u)
-						$s .= &#039;=&#039; . $this-&gt;parseTree($u);
-				}
-			break;
-
-			case KEYWORD_IN:
-			case KEYWORD_INSTANCEOF:
-				$left = $this-&gt;parseTree($n-&gt;treeNodes[0]);
-				$right = $this-&gt;parseTree($n-&gt;treeNodes[1]);
-
-				$s = $left;
-
-				if ($this-&gt;isWordChar(substr($left, -1)))
-					$s .= &#039; &#039;;
-
-				$s .= $n-&gt;type;
-
-				if ($this-&gt;isWordChar($right[0]) || $right[0] == &#039;\\&#039;)
-					$s .= &#039; &#039;;
-
-				$s .= $right;
-			break;
-
-			case KEYWORD_DELETE:
-			case KEYWORD_TYPEOF:
-				$right = $this-&gt;parseTree($n-&gt;treeNodes[0]);
-
-				$s = $n-&gt;type;
-
-				if ($this-&gt;isWordChar($right[0]) || $right[0] == &#039;\\&#039;)
-					$s .= &#039; &#039;;
-
-				$s .= $right;
-			break;
-
-			case KEYWORD_VOID:
-				$s = &#039;void(&#039; . $this-&gt;parseTree($n-&gt;treeNodes[0]) . &#039;)&#039;;
-			break;
-
-			case KEYWORD_DEBUGGER:
-				throw new Exception(&#039;NOT IMPLEMENTED: DEBUGGER&#039;);
-			break;
-
-			case TOKEN_CONDCOMMENT_START:
-			case TOKEN_CONDCOMMENT_END:
-				$s = $n-&gt;value . ($n-&gt;type == TOKEN_CONDCOMMENT_START ? &#039; &#039; : &#039;&#039;);
-				$childs = $n-&gt;treeNodes;
-				for ($i = 0, $j = count($childs); $i &lt; $j; $i++)
-					$s .= $this-&gt;parseTree($childs[$i]);
-			break;
-
-			case OP_SEMICOLON:
-				if ($expression = $n-&gt;expression)
-					$s = $this-&gt;parseTree($expression);
-			break;
-
-			case JS_LABEL:
-				$s = $n-&gt;label . &#039;:&#039; . $this-&gt;parseTree($n-&gt;statement);
-			break;
-
-			case OP_COMMA:
-				$childs = $n-&gt;treeNodes;
-				for ($i = 0, $j = count($childs); $i &lt; $j; $i++)
-					$s .= ($i ? &#039;,&#039; : &#039;&#039;) . $this-&gt;parseTree($childs[$i]);
-			break;
-
-			case OP_ASSIGN:
-				$s = $this-&gt;parseTree($n-&gt;treeNodes[0]) . $n-&gt;value . $this-&gt;parseTree($n-&gt;treeNodes[1]);
-			break;
-
-			case OP_HOOK:
-				$s = $this-&gt;parseTree($n-&gt;treeNodes[0]) . &#039;?&#039; . $this-&gt;parseTree($n-&gt;treeNodes[1]) . &#039;:&#039; . $this-&gt;parseTree($n-&gt;treeNodes[2]);
-			break;
-
-			case OP_OR: case OP_AND:
-			case OP_BITWISE_OR: case OP_BITWISE_XOR: case OP_BITWISE_AND:
-			case OP_EQ: case OP_NE: case OP_STRICT_EQ: case OP_STRICT_NE:
-			case OP_LT: case OP_LE: case OP_GE: case OP_GT:
-			case OP_LSH: case OP_RSH: case OP_URSH:
-			case OP_MUL: case OP_DIV: case OP_MOD:
-				$s = $this-&gt;parseTree($n-&gt;treeNodes[0]) . $n-&gt;type . $this-&gt;parseTree($n-&gt;treeNodes[1]);
-			break;
-
-			case OP_PLUS:
-			case OP_MINUS:
-				$left = $this-&gt;parseTree($n-&gt;treeNodes[0]);
-				$right = $this-&gt;parseTree($n-&gt;treeNodes[1]);
-
-				switch ($n-&gt;treeNodes[1]-&gt;type)
-				{
-					case OP_PLUS:
-					case OP_MINUS:
-					case OP_INCREMENT:
-					case OP_DECREMENT:
-					case OP_UNARY_PLUS:
-					case OP_UNARY_MINUS:
-						$s = $left . $n-&gt;type . &#039; &#039; . $right;
-					break;
-
-					case TOKEN_STRING:
-						//combine concatted strings with same quotestyle
-						if ($n-&gt;type == OP_PLUS &amp;&amp; substr($left, -1) == $right[0])
-						{
-							$s = substr($left, 0, -1) . substr($right, 1);
-							break;
-						}
-					// FALL THROUGH
-
-					default:
-						$s = $left . $n-&gt;type . $right;
-				}
-			break;
-
-			case OP_NOT:
-			case OP_BITWISE_NOT:
-			case OP_UNARY_PLUS:
-			case OP_UNARY_MINUS:
-				$s = $n-&gt;value . $this-&gt;parseTree($n-&gt;treeNodes[0]);
-			break;
-
-			case OP_INCREMENT:
-			case OP_DECREMENT:
-				if ($n-&gt;postfix)
-					$s = $this-&gt;parseTree($n-&gt;treeNodes[0]) . $n-&gt;value;
-				else
-					$s = $n-&gt;value . $this-&gt;parseTree($n-&gt;treeNodes[0]);
-			break;
-
-			case OP_DOT:
-				$s = $this-&gt;parseTree($n-&gt;treeNodes[0]) . &#039;.&#039; . $this-&gt;parseTree($n-&gt;treeNodes[1]);
-			break;
-
-			case JS_INDEX:
-				$s = $this-&gt;parseTree($n-&gt;treeNodes[0]);
-				// See if we can replace named index with a dot saving 3 bytes
-				if (	$n-&gt;treeNodes[0]-&gt;type == TOKEN_IDENTIFIER &amp;&amp;
+        $body  = $this-&gt;parseTree($n-&gt;body);
+        if ($body == &#039;&#039;) {
+          $body = &#039;;&#039;;
+        }
+
+        $s .= $body;
+        break;
+
+      case KEYWORD_WHILE:
+        $s = &#039;while(&#039; . $this-&gt;parseTree($n-&gt;condition) . &#039;)&#039;;
+
+        $body  = $this-&gt;parseTree($n-&gt;body);
+        if ($body == &#039;&#039;) {
+          $body = &#039;;&#039;;
+        }
+
+        $s .= $body;
+        break;
+
+      case JS_FOR_IN:
+        $s = &#039;for(&#039; . ($n-&gt;varDecl ? $this-&gt;parseTree($n-&gt;varDecl) : $this-&gt;parseTree($n-&gt;iterator)) . &#039; in &#039; . $this-&gt;parseTree($n-&gt;object) . &#039;)&#039;;
+
+        $body  = $this-&gt;parseTree($n-&gt;body);
+        if ($body == &#039;&#039;) {
+          $body = &#039;;&#039;;
+        }
+
+        $s .= $body;
+        break;
+
+      case KEYWORD_DO:
+        $s = &#039;do{&#039; . $this-&gt;parseTree($n-&gt;body, true) . &#039;}while(&#039; . $this-&gt;parseTree($n-&gt;condition) . &#039;)&#039;;
+        break;
+
+      case KEYWORD_BREAK:
+      case KEYWORD_CONTINUE:
+        $s = $n-&gt;value . ($n-&gt;label ? &#039; &#039; . $n-&gt;label : &#039;&#039;);
+        break;
+
+      case KEYWORD_TRY:
+        $s = &#039;try{&#039; . $this-&gt;parseTree($n-&gt;tryBlock, true) . &#039;}&#039;;
+        $catchClauses = $n-&gt;catchClauses;
+        for ($i = 0, $j = count($catchClauses); $i &lt; $j; $i++) {
+          $t = $catchClauses[$i];
+          $s .= &#039;catch(&#039; . $t-&gt;varName . ($t-&gt;guard ? &#039; if &#039; . $this-&gt;parseTree($t-&gt;guard) : &#039;&#039;) . &#039;){&#039; . $this-&gt;parseTree($t-&gt;block, true) . &#039;}&#039;;
+        }
+        if ($n-&gt;finallyBlock) {
+          $s .= &#039;finally{&#039; . $this-&gt;parseTree($n-&gt;finallyBlock, true) . &#039;}&#039;;
+        }
+        break;
+
+      case KEYWORD_THROW:
+      case KEYWORD_RETURN:
+        $s = $n-&gt;type;
+        if ($n-&gt;value) {
+          $t = $this-&gt;parseTree($n-&gt;value);
+          if (strlen($t)) {
+            if ($this-&gt;isWordChar($t[0]) || $t[0] == &#039;\\&#039;) {
+              $s .= &#039; &#039;;
+            }
+
+            $s .= $t;
+          }
+        }
+        break;
+
+      case KEYWORD_WITH:
+        $s = &#039;with(&#039; . $this-&gt;parseTree($n-&gt;object) . &#039;)&#039; . $this-&gt;parseTree($n-&gt;body);
+        break;
+
+      case KEYWORD_VAR:
+      case KEYWORD_CONST:
+        $s = $n-&gt;value . &#039; &#039;;
+        $childs = $n-&gt;treeNodes;
+        for ($i = 0, $j = count($childs); $i &lt; $j; $i++) {
+          $t = $childs[$i];
+          $s .= ($i ? &#039;,&#039; : &#039;&#039;) . $t-&gt;name;
+          $u = $t-&gt;initializer;
+          if ($u) {
+            $s .= &#039;=&#039; . $this-&gt;parseTree($u);
+          }
+        }
+        break;
+
+      case KEYWORD_IN:
+      case KEYWORD_INSTANCEOF:
+        $left = $this-&gt;parseTree($n-&gt;treeNodes[0]);
+        $right = $this-&gt;parseTree($n-&gt;treeNodes[1]);
+
+        $s = $left;
+
+        if ($this-&gt;isWordChar(substr($left, -1))) {
+          $s .= &#039; &#039;;
+        }
+
+        $s .= $n-&gt;type;
+
+        if ($this-&gt;isWordChar($right[0]) || $right[0] == &#039;\\&#039;) {
+          $s .= &#039; &#039;;
+        }
+
+        $s .= $right;
+        break;
+
+      case KEYWORD_DELETE:
+      case KEYWORD_TYPEOF:
+        $right = $this-&gt;parseTree($n-&gt;treeNodes[0]);
+
+        $s = $n-&gt;type;
+
+        if ($this-&gt;isWordChar($right[0]) || $right[0] == &#039;\\&#039;) {
+          $s .= &#039; &#039;;
+        }
+
+        $s .= $right;
+        break;
+
+      case KEYWORD_VOID:
+        $s = &#039;void(&#039; . $this-&gt;parseTree($n-&gt;treeNodes[0]) . &#039;)&#039;;
+        break;
+
+      case KEYWORD_DEBUGGER:
+        throw new Exception(&#039;NOT IMPLEMENTED: DEBUGGER&#039;);
+        break;
+
+      case TOKEN_CONDCOMMENT_START:
+      case TOKEN_CONDCOMMENT_END:
+        $s = $n-&gt;value . ($n-&gt;type == TOKEN_CONDCOMMENT_START ? &#039; &#039; : &#039;&#039;);
+        $childs = $n-&gt;treeNodes;
+        for ($i = 0, $j = count($childs); $i &lt; $j; $i++) {
+          $s .= $this-&gt;parseTree($childs[$i]);
+        }
+        break;
+
+      case OP_SEMICOLON:
+        if ($expression = $n-&gt;expression) {
+          $s = $this-&gt;parseTree($expression);
+        }
+        break;
+
+      case JS_LABEL:
+        $s = $n-&gt;label . &#039;:&#039; . $this-&gt;parseTree($n-&gt;statement);
+        break;
+
+      case OP_COMMA:
+        $childs = $n-&gt;treeNodes;
+        for ($i = 0, $j = count($childs); $i &lt; $j; $i++) {
+          $s .= ($i ? &#039;,&#039; : &#039;&#039;) . $this-&gt;parseTree($childs[$i]);
+        }
+        break;
+
+      case OP_ASSIGN:
+        $s = $this-&gt;parseTree($n-&gt;treeNodes[0]) . $n-&gt;value . $this-&gt;parseTree($n-&gt;treeNodes[1]);
+        break;
+
+      case OP_HOOK:
+        $s = $this-&gt;parseTree($n-&gt;treeNodes[0]) . &#039;?&#039; . $this-&gt;parseTree($n-&gt;treeNodes[1]) . &#039;:&#039; . $this-&gt;parseTree($n-&gt;treeNodes[2]);
+        break;
+
+      case OP_OR:
+      case OP_AND:
+      case OP_BITWISE_OR:
+      case OP_BITWISE_XOR:
+      case OP_BITWISE_AND:
+      case OP_EQ:
+      case OP_NE:
+      case OP_STRICT_EQ:
+      case OP_STRICT_NE:
+      case OP_LT:
+      case OP_LE:
+      case OP_GE:
+      case OP_GT:
+      case OP_LSH:
+      case OP_RSH:
+      case OP_URSH:
+      case OP_MUL:
+      case OP_DIV:
+      case OP_MOD:
+        $s = $this-&gt;parseTree($n-&gt;treeNodes[0]) . $n-&gt;type . $this-&gt;parseTree($n-&gt;treeNodes[1]);
+        break;
+
+      case OP_PLUS:
+      case OP_MINUS:
+        $left = $this-&gt;parseTree($n-&gt;treeNodes[0]);
+        $right = $this-&gt;parseTree($n-&gt;treeNodes[1]);
+
+        switch ($n-&gt;treeNodes[1]-&gt;type) {
+          case OP_PLUS:
+          case OP_MINUS:
+          case OP_INCREMENT:
+          case OP_DECREMENT:
+          case OP_UNARY_PLUS:
+          case OP_UNARY_MINUS:
+            $s = $left . $n-&gt;type . &#039; &#039; . $right;
+            break;
+
+          case TOKEN_STRING:
+            //combine concatted strings with same quotestyle
+            if ($n-&gt;type == OP_PLUS &amp;&amp; substr($left, -1) == $right[0]) {
+              $s = substr($left, 0, -1) . substr($right, 1);
+              break;
+            }
+            // FALL THROUGH
+
+          default:
+            $s = $left . $n-&gt;type . $right;
+        }
+        break;
+
+      case OP_NOT:
+      case OP_BITWISE_NOT:
+      case OP_UNARY_PLUS:
+      case OP_UNARY_MINUS:
+        $s = $n-&gt;value . $this-&gt;parseTree($n-&gt;treeNodes[0]);
+        break;
+
+      case OP_INCREMENT:
+      case OP_DECREMENT:
+        if ($n-&gt;postfix) {
+          $s = $this-&gt;parseTree($n-&gt;treeNodes[0]) . $n-&gt;value;
+        }
+        else {
+          $s = $n-&gt;value . $this-&gt;parseTree($n-&gt;treeNodes[0]);
+        }
+        break;
+
+      case OP_DOT:
+        $s = $this-&gt;parseTree($n-&gt;treeNodes[0]) . &#039;.&#039; . $this-&gt;parseTree($n-&gt;treeNodes[1]);
+        break;
+
+      case JS_INDEX:
+        $s = $this-&gt;parseTree($n-&gt;treeNodes[0]);
+        // See if we can replace named index with a dot saving 3 bytes
+        if (	$n-&gt;treeNodes[0]-&gt;type == TOKEN_IDENTIFIER &amp;&amp;
 					$n-&gt;treeNodes[1]-&gt;type == TOKEN_STRING &amp;&amp;
 					$this-&gt;isValidIdentifier(substr($n-&gt;treeNodes[1]-&gt;value, 1, -1))
-				)
-					$s .= &#039;.&#039; . substr($n-&gt;treeNodes[1]-&gt;value, 1, -1);
-				else
-					$s .= &#039;[&#039; . $this-&gt;parseTree($n-&gt;treeNodes[1]) . &#039;]&#039;;
-			break;
-
-			case JS_LIST:
-				$childs = $n-&gt;treeNodes;
-				for ($i = 0, $j = count($childs); $i &lt; $j; $i++)
-					$s .= ($i ? &#039;,&#039; : &#039;&#039;) . $this-&gt;parseTree($childs[$i]);
-			break;
-
-			case JS_CALL:
-				$s = $this-&gt;parseTree($n-&gt;treeNodes[0]) . &#039;(&#039; . $this-&gt;parseTree($n-&gt;treeNodes[1]) . &#039;)&#039;;
-			break;
-
-			case KEYWORD_NEW:
-			case JS_NEW_WITH_ARGS:
-				$s = &#039;new &#039; . $this-&gt;parseTree($n-&gt;treeNodes[0]) . &#039;(&#039; . ($n-&gt;type == JS_NEW_WITH_ARGS ? $this-&gt;parseTree($n-&gt;treeNodes[1]) : &#039;&#039;) . &#039;)&#039;;
-			break;
-
-			case JS_ARRAY_INIT:
-				$s = &#039;[&#039;;
-				$childs = $n-&gt;treeNodes;
-				for ($i = 0, $j = count($childs); $i &lt; $j; $i++)
-				{
-					$s .= ($i ? &#039;,&#039; : &#039;&#039;) . $this-&gt;parseTree($childs[$i]);
-				}
-				$s .= &#039;]&#039;;
-			break;
-
-			case JS_OBJECT_INIT:
-				$s = &#039;{&#039;;
-				$childs = $n-&gt;treeNodes;
-				for ($i = 0, $j = count($childs); $i &lt; $j; $i++)
-				{
-					$t = $childs[$i];
-					if ($i)
-						$s .= &#039;,&#039;;
-					if ($t-&gt;type == JS_PROPERTY_INIT)
-					{
-						// Ditch the quotes when the index is a valid identifier
-						if (	$t-&gt;treeNodes[0]-&gt;type == TOKEN_STRING &amp;&amp;
+				) {
+          $s .= &#039;.&#039; . substr($n-&gt;treeNodes[1]-&gt;value, 1, -1);
+        }
+        else {
+          $s .= &#039;[&#039; . $this-&gt;parseTree($n-&gt;treeNodes[1]) . &#039;]&#039;;
+        }
+        break;
+
+      case JS_LIST:
+        $childs = $n-&gt;treeNodes;
+        for ($i = 0, $j = count($childs); $i &lt; $j; $i++) {
+          $s .= ($i ? &#039;,&#039; : &#039;&#039;) . $this-&gt;parseTree($childs[$i]);
+        }
+        break;
+
+      case JS_CALL:
+        $s = $this-&gt;parseTree($n-&gt;treeNodes[0]) . &#039;(&#039; . $this-&gt;parseTree($n-&gt;treeNodes[1]) . &#039;)&#039;;
+        break;
+
+      case KEYWORD_NEW:
+      case JS_NEW_WITH_ARGS:
+        $s = &#039;new &#039; . $this-&gt;parseTree($n-&gt;treeNodes[0]) . &#039;(&#039; . ($n-&gt;type == JS_NEW_WITH_ARGS ? $this-&gt;parseTree($n-&gt;treeNodes[1]) : &#039;&#039;) . &#039;)&#039;;
+        break;
+
+      case JS_ARRAY_INIT:
+        $s = &#039;[&#039;;
+        $childs = $n-&gt;treeNodes;
+        for ($i = 0, $j = count($childs); $i &lt; $j; $i++) {
+          $s .= ($i ? &#039;,&#039; : &#039;&#039;) . $this-&gt;parseTree($childs[$i]);
+        }
+        $s .= &#039;]&#039;;
+        break;
+
+      case JS_OBJECT_INIT:
+        $s = &#039;{&#039;;
+        $childs = $n-&gt;treeNodes;
+        for ($i = 0, $j = count($childs); $i &lt; $j; $i++) {
+          $t = $childs[$i];
+          if ($i) {
+            $s .= &#039;,&#039;;
+          }
+          if ($t-&gt;type == JS_PROPERTY_INIT) {
+            // Ditch the quotes when the index is a valid identifier
+            if (	$t-&gt;treeNodes[0]-&gt;type == TOKEN_STRING &amp;&amp;
 							$this-&gt;isValidIdentifier(substr($t-&gt;treeNodes[0]-&gt;value, 1, -1))
-						)
-							$s .= substr($t-&gt;treeNodes[0]-&gt;value, 1, -1);
-						else
-							$s .= $t-&gt;treeNodes[0]-&gt;value;
-
-						$s .= &#039;:&#039; . $this-&gt;parseTree($t-&gt;treeNodes[1]);
-					}
-					else
-					{
-						$s .= $t-&gt;type == JS_GETTER ? &#039;get&#039; : &#039;set&#039;;
-						$s .= &#039; &#039; . $t-&gt;name . &#039;(&#039;;
-						$params = $t-&gt;params;
-						for ($i = 0, $j = count($params); $i &lt; $j; $i++)
-							$s .= ($i ? &#039;,&#039; : &#039;&#039;) . $params[$i];
-						$s .= &#039;){&#039; . $this-&gt;parseTree($t-&gt;body, true) . &#039;}&#039;;
-					}
-				}
-				$s .= &#039;}&#039;;
-			break;
-
-			case TOKEN_NUMBER:
-				$s = $n-&gt;value;
-				if (preg_match(&#039;/^([1-9]+)(0{3,})$/&#039;, $s, $m))
-					$s = $m[1] . &#039;e&#039; . strlen($m[2]);
-			break;
-
-			case KEYWORD_NULL: case KEYWORD_THIS: case KEYWORD_TRUE: case KEYWORD_FALSE:
-			case TOKEN_IDENTIFIER: case TOKEN_STRING: case TOKEN_REGEXP:
-				$s = $n-&gt;value;
-			break;
+						) {
+              $s .= substr($t-&gt;treeNodes[0]-&gt;value, 1, -1);
+            }
+            else {
+              $s .= $t-&gt;treeNodes[0]-&gt;value;
+            }
+
+            $s .= &#039;:&#039; . $this-&gt;parseTree($t-&gt;treeNodes[1]);
+          }
+          else {
+            $s .= $t-&gt;type == JS_GETTER ? &#039;get&#039; : &#039;set&#039;;
+            $s .= &#039; &#039; . $t-&gt;name . &#039;(&#039;;
+            $params = $t-&gt;params;
+            for ($i = 0, $j = count($params); $i &lt; $j; $i++) {
+              $s .= ($i ? &#039;,&#039; : &#039;&#039;) . $params[$i];
+            }
+            $s .= &#039;){&#039; . $this-&gt;parseTree($t-&gt;body, true) . &#039;}&#039;;
+          }
+        }
+        $s .= &#039;}&#039;;
+        break;
+
+      case TOKEN_NUMBER:
+        $s = $n-&gt;value;
+        if (preg_match(&#039;/^([1-9]+)(0{3,})$/&#039;, $s, $m)) {
+          $s = $m[1] . &#039;e&#039; . strlen($m[2]);
+        }
+        break;
+
+      case KEYWORD_NULL:
+      case KEYWORD_THIS:
+      case KEYWORD_TRUE:
+      case KEYWORD_FALSE:
+      case TOKEN_IDENTIFIER:
+      case TOKEN_STRING:
+      case TOKEN_REGEXP:
+        $s = $n-&gt;value;
+        break;
 
-			case JS_GROUP:
-				if (in_array(
+      case JS_GROUP:
+        if (in_array(
 					$n-&gt;treeNodes[0]-&gt;type,
 					array(
-						JS_ARRAY_INIT, JS_OBJECT_INIT, JS_GROUP,
-						TOKEN_NUMBER, TOKEN_STRING, TOKEN_REGEXP, TOKEN_IDENTIFIER,
-						KEYWORD_NULL, KEYWORD_THIS, KEYWORD_TRUE, KEYWORD_FALSE
-					)
-				))
-				{
-					$s = $this-&gt;parseTree($n-&gt;treeNodes[0]);
-				}
-				else
-				{
-					$s = &#039;(&#039; . $this-&gt;parseTree($n-&gt;treeNodes[0]) . &#039;)&#039;;
-				}
-			break;
-
-			default:
-				throw new Exception(&#039;UNKNOWN TOKEN TYPE: &#039; . $n-&gt;type);
-		}
-
-		return $s;
-	}
-
-	private function isValidIdentifier($string)
-	{
-		return preg_match(&#039;/^[a-zA-Z_][a-zA-Z0-9_]*$/&#039;, $string) &amp;&amp; !in_array($string, $this-&gt;reserved);
-	}
-
-	private function isWordChar($char)
-	{
-		return $char == &#039;_&#039; || $char == &#039;$&#039; || ctype_alnum($char);
-	}
+          JS_ARRAY_INIT,
+          JS_OBJECT_INIT,
+          JS_GROUP,
+          TOKEN_NUMBER,
+          TOKEN_STRING,
+          TOKEN_REGEXP,
+          TOKEN_IDENTIFIER,
+          KEYWORD_NULL,
+          KEYWORD_THIS,
+          KEYWORD_TRUE,
+          KEYWORD_FALSE,
+        )
+				)) {
+          $s = $this-&gt;parseTree($n-&gt;treeNodes[0]);
+        }
+        else {
+          $s = &#039;(&#039; . $this-&gt;parseTree($n-&gt;treeNodes[0]) . &#039;)&#039;;
+        }
+        break;
+
+      default:
+        throw new Exception(&#039;UNKNOWN TOKEN TYPE: &#039; . $n-&gt;type);
+    }
+
+    return $s;
+  }
+
+  private function isValidIdentifier($string) {
+    return preg_match(&#039;/^[a-zA-Z_][a-zA-Z0-9_]*$/&#039;, $string) &amp;&amp; !in_array($string, $this-&gt;reserved);
+  }
+
+  private function isWordChar($char) {
+    return $char == &#039;_&#039; || $char == &#039;$&#039; || ctype_alnum($char);
+  }
 }
 
-class JSParser
-{
-	private $t;
-	private $minifier;
-
-	private $opPrecedence = array(
-		&#039;;&#039; =&gt; 0,
-		&#039;,&#039; =&gt; 1,
-		&#039;=&#039; =&gt; 2, &#039;?&#039; =&gt; 2, &#039;:&#039; =&gt; 2,
-		// The above all have to have the same precedence, see bug 330975
-		&#039;||&#039; =&gt; 4,
-		&#039;&amp;&amp;&#039; =&gt; 5,
-		&#039;|&#039; =&gt; 6,
-		&#039;^&#039; =&gt; 7,
-		&#039;&amp;&#039; =&gt; 8,
-		&#039;==&#039; =&gt; 9, &#039;!=&#039; =&gt; 9, &#039;===&#039; =&gt; 9, &#039;!==&#039; =&gt; 9,
-		&#039;&lt;&#039; =&gt; 10, &#039;&lt;=&#039; =&gt; 10, &#039;&gt;=&#039; =&gt; 10, &#039;&gt;&#039; =&gt; 10, &#039;in&#039; =&gt; 10, &#039;instanceof&#039; =&gt; 10,
-		&#039;&lt;&lt;&#039; =&gt; 11, &#039;&gt;&gt;&#039; =&gt; 11, &#039;&gt;&gt;&gt;&#039; =&gt; 11,
-		&#039;+&#039; =&gt; 12, &#039;-&#039; =&gt; 12,
-		&#039;*&#039; =&gt; 13, &#039;/&#039; =&gt; 13, &#039;%&#039; =&gt; 13,
-		&#039;delete&#039; =&gt; 14, &#039;void&#039; =&gt; 14, &#039;typeof&#039; =&gt; 14,
-		&#039;!&#039; =&gt; 14, &#039;~&#039; =&gt; 14, &#039;U+&#039; =&gt; 14, &#039;U-&#039; =&gt; 14,
-		&#039;++&#039; =&gt; 15, &#039;--&#039; =&gt; 15,
-		&#039;new&#039; =&gt; 16,
-		&#039;.&#039; =&gt; 17,
-		JS_NEW_WITH_ARGS =&gt; 0, JS_INDEX =&gt; 0, JS_CALL =&gt; 0,
-		JS_ARRAY_INIT =&gt; 0, JS_OBJECT_INIT =&gt; 0, JS_GROUP =&gt; 0
-	);
-
-	private $opArity = array(
-		&#039;,&#039; =&gt; -2,
-		&#039;=&#039; =&gt; 2,
-		&#039;?&#039; =&gt; 3,
-		&#039;||&#039; =&gt; 2,
-		&#039;&amp;&amp;&#039; =&gt; 2,
-		&#039;|&#039; =&gt; 2,
-		&#039;^&#039; =&gt; 2,
-		&#039;&amp;&#039; =&gt; 2,
-		&#039;==&#039; =&gt; 2, &#039;!=&#039; =&gt; 2, &#039;===&#039; =&gt; 2, &#039;!==&#039; =&gt; 2,
-		&#039;&lt;&#039; =&gt; 2, &#039;&lt;=&#039; =&gt; 2, &#039;&gt;=&#039; =&gt; 2, &#039;&gt;&#039; =&gt; 2, &#039;in&#039; =&gt; 2, &#039;instanceof&#039; =&gt; 2,
-		&#039;&lt;&lt;&#039; =&gt; 2, &#039;&gt;&gt;&#039; =&gt; 2, &#039;&gt;&gt;&gt;&#039; =&gt; 2,
-		&#039;+&#039; =&gt; 2, &#039;-&#039; =&gt; 2,
-		&#039;*&#039; =&gt; 2, &#039;/&#039; =&gt; 2, &#039;%&#039; =&gt; 2,
-		&#039;delete&#039; =&gt; 1, &#039;void&#039; =&gt; 1, &#039;typeof&#039; =&gt; 1,
-		&#039;!&#039; =&gt; 1, &#039;~&#039; =&gt; 1, &#039;U+&#039; =&gt; 1, &#039;U-&#039; =&gt; 1,
-		&#039;++&#039; =&gt; 1, &#039;--&#039; =&gt; 1,
-		&#039;new&#039; =&gt; 1,
-		&#039;.&#039; =&gt; 2,
-		JS_NEW_WITH_ARGS =&gt; 2, JS_INDEX =&gt; 2, JS_CALL =&gt; 2,
-		JS_ARRAY_INIT =&gt; 1, JS_OBJECT_INIT =&gt; 1, JS_GROUP =&gt; 1,
-		TOKEN_CONDCOMMENT_START =&gt; 1, TOKEN_CONDCOMMENT_END =&gt; 1
-	);
-
-	public function __construct($minifier=null)
-	{
-		$this-&gt;minifier = $minifier;
-		$this-&gt;t = new JSTokenizer();
-	}
-
-	public function parse($s, $f, $l)
-	{
-		// initialize tokenizer
-		$this-&gt;t-&gt;init($s, $f, $l);
-
-		$x = new JSCompilerContext(false);
-		$n = $this-&gt;Script($x);
-		if (!$this-&gt;t-&gt;isDone())
-			throw $this-&gt;t-&gt;newSyntaxError(&#039;Syntax error&#039;);
-
-		return $n;
-	}
-
-	private function Script($x)
-	{
-		$n = $this-&gt;Statements($x);
-		$n-&gt;type = JS_SCRIPT;
-		$n-&gt;funDecls = $x-&gt;funDecls;
-		$n-&gt;varDecls = $x-&gt;varDecls;
-
-		// minify by scope
-		if ($this-&gt;minifier)
-		{
-			$n-&gt;value = $this-&gt;minifier-&gt;parseTree($n);
-
-			// clear tree from node to save memory
-			$n-&gt;treeNodes = null;
-			$n-&gt;funDecls = null;
-			$n-&gt;varDecls = null;
-
-			$n-&gt;type = JS_MINIFIED;
-		}
-
-		return $n;
-	}
-
-	private function Statements($x)
-	{
-		$n = new JSNode($this-&gt;t, JS_BLOCK);
-		array_push($x-&gt;stmtStack, $n);
-
-		while (!$this-&gt;t-&gt;isDone() &amp;&amp; $this-&gt;t-&gt;peek() != OP_RIGHT_CURLY)
-			$n-&gt;addNode($this-&gt;Statement($x));
-
-		array_pop($x-&gt;stmtStack);
-
-		return $n;
-	}
-
-	private function Block($x)
-	{
-		$this-&gt;t-&gt;mustMatch(OP_LEFT_CURLY);
-		$n = $this-&gt;Statements($x);
-		$this-&gt;t-&gt;mustMatch(OP_RIGHT_CURLY);
-
-		return $n;
-	}
-
-	private function Statement($x)
-	{
-		$tt = $this-&gt;t-&gt;get();
-		$n2 = null;
-
-		// Cases for statements ending in a right curly return early, avoiding the
-		// common semicolon insertion magic after this switch.
-		switch ($tt)
-		{
-			case KEYWORD_FUNCTION:
-				return $this-&gt;FunctionDefinition(
+class JSParser {
+  private $t;
+  private $minifier;
+
+  private $opPrecedence = array(
+    &#039;;&#039; =&gt; 0,
+    &#039;,&#039; =&gt; 1,
+    &#039;=&#039; =&gt; 2,
+    &#039;?&#039; =&gt; 2,
+    &#039;:&#039; =&gt; 2,
+    // The above all have to have the same precedence, see bug 330975
+    &#039;||&#039; =&gt; 4,
+    &#039;&amp;&amp;&#039; =&gt; 5,
+    &#039;|&#039; =&gt; 6,
+    &#039;^&#039; =&gt; 7,
+    &#039;&amp;&#039; =&gt; 8,
+    &#039;==&#039; =&gt; 9,
+    &#039;!=&#039; =&gt; 9,
+    &#039;===&#039; =&gt; 9,
+    &#039;!==&#039; =&gt; 9,
+    &#039;&lt;&#039; =&gt; 10,
+    &#039;&lt;=&#039; =&gt; 10,
+    &#039;&gt;=&#039; =&gt; 10,
+    &#039;&gt;&#039; =&gt; 10,
+    &#039;in&#039; =&gt; 10,
+    &#039;instanceof&#039; =&gt; 10,
+    &#039;&lt;&lt;&#039; =&gt; 11,
+    &#039;&gt;&gt;&#039; =&gt; 11,
+    &#039;&gt;&gt;&gt;&#039; =&gt; 11,
+    &#039;+&#039; =&gt; 12,
+    &#039;-&#039; =&gt; 12,
+    &#039;*&#039; =&gt; 13,
+    &#039;/&#039; =&gt; 13,
+    &#039;%&#039; =&gt; 13,
+    &#039;delete&#039; =&gt; 14,
+    &#039;void&#039; =&gt; 14,
+    &#039;typeof&#039; =&gt; 14,
+    &#039;!&#039; =&gt; 14,
+    &#039;~&#039; =&gt; 14,
+    &#039;U+&#039; =&gt; 14,
+    &#039;U-&#039; =&gt; 14,
+    &#039;++&#039; =&gt; 15,
+    &#039;--&#039; =&gt; 15,
+    &#039;new&#039; =&gt; 16,
+    &#039;.&#039; =&gt; 17,
+    JS_NEW_WITH_ARGS =&gt; 0,
+    JS_INDEX =&gt; 0,
+    JS_CALL =&gt; 0,
+    JS_ARRAY_INIT =&gt; 0,
+    JS_OBJECT_INIT =&gt; 0,
+    JS_GROUP =&gt; 0,
+  );
+
+  private $opArity = array(
+    &#039;,&#039; =&gt; -2,
+    &#039;=&#039; =&gt; 2,
+    &#039;?&#039; =&gt; 3,
+    &#039;||&#039; =&gt; 2,
+    &#039;&amp;&amp;&#039; =&gt; 2,
+    &#039;|&#039; =&gt; 2,
+    &#039;^&#039; =&gt; 2,
+    &#039;&amp;&#039; =&gt; 2,
+    &#039;==&#039; =&gt; 2,
+    &#039;!=&#039; =&gt; 2,
+    &#039;===&#039; =&gt; 2,
+    &#039;!==&#039; =&gt; 2,
+    &#039;&lt;&#039; =&gt; 2,
+    &#039;&lt;=&#039; =&gt; 2,
+    &#039;&gt;=&#039; =&gt; 2,
+    &#039;&gt;&#039; =&gt; 2,
+    &#039;in&#039; =&gt; 2,
+    &#039;instanceof&#039; =&gt; 2,
+    &#039;&lt;&lt;&#039; =&gt; 2,
+    &#039;&gt;&gt;&#039; =&gt; 2,
+    &#039;&gt;&gt;&gt;&#039; =&gt; 2,
+    &#039;+&#039; =&gt; 2,
+    &#039;-&#039; =&gt; 2,
+    &#039;*&#039; =&gt; 2,
+    &#039;/&#039; =&gt; 2,
+    &#039;%&#039; =&gt; 2,
+    &#039;delete&#039; =&gt; 1,
+    &#039;void&#039; =&gt; 1,
+    &#039;typeof&#039; =&gt; 1,
+    &#039;!&#039; =&gt; 1,
+    &#039;~&#039; =&gt; 1,
+    &#039;U+&#039; =&gt; 1,
+    &#039;U-&#039; =&gt; 1,
+    &#039;++&#039; =&gt; 1,
+    &#039;--&#039; =&gt; 1,
+    &#039;new&#039; =&gt; 1,
+    &#039;.&#039; =&gt; 2,
+    JS_NEW_WITH_ARGS =&gt; 2,
+    JS_INDEX =&gt; 2,
+    JS_CALL =&gt; 2,
+    JS_ARRAY_INIT =&gt; 1,
+    JS_OBJECT_INIT =&gt; 1,
+    JS_GROUP =&gt; 1,
+    TOKEN_CONDCOMMENT_START =&gt; 1,
+    TOKEN_CONDCOMMENT_END =&gt; 1,
+  );
+
+  public function __construct($minifier = null) {
+    $this-&gt;minifier = $minifier;
+    $this-&gt;t = new JSTokenizer();
+  }
+
+  public function parse($s, $f, $l) {
+    // initialize tokenizer
+    $this-&gt;t-&gt;init($s, $f, $l);
+
+    $x = new JSCompilerContext(false);
+    $n = $this-&gt;Script($x);
+    if (!$this-&gt;t-&gt;isDone()) {
+      throw $this-&gt;t-&gt;newSyntaxError(&#039;Syntax error&#039;);
+    }
+
+    return $n;
+  }
+
+  private function Script($x) {
+    $n = $this-&gt;Statements($x);
+    $n-&gt;type = JS_SCRIPT;
+    $n-&gt;funDecls = $x-&gt;funDecls;
+    $n-&gt;varDecls = $x-&gt;varDecls;
+
+    // minify by scope
+    if ($this-&gt;minifier) {
+      $n-&gt;value = $this-&gt;minifier-&gt;parseTree($n);
+
+      // clear tree from node to save memory
+      $n-&gt;treeNodes = null;
+      $n-&gt;funDecls = null;
+      $n-&gt;varDecls = null;
+
+      $n-&gt;type = JS_MINIFIED;
+    }
+
+    return $n;
+  }
+
+  private function Statements($x) {
+    $n = new JSNode($this-&gt;t, JS_BLOCK);
+    array_push($x-&gt;stmtStack, $n);
+
+    while (!$this-&gt;t-&gt;isDone() &amp;&amp; $this-&gt;t-&gt;peek() != OP_RIGHT_CURLY) {
+      $n-&gt;addNode($this-&gt;Statement($x));
+    }
+
+    array_pop($x-&gt;stmtStack);
+
+    return $n;
+  }
+
+  private function Block($x) {
+    $this-&gt;t-&gt;mustMatch(OP_LEFT_CURLY);
+    $n = $this-&gt;Statements($x);
+    $this-&gt;t-&gt;mustMatch(OP_RIGHT_CURLY);
+
+    return $n;
+  }
+
+  private function Statement($x) {
+    $tt = $this-&gt;t-&gt;get();
+    $n2 = null;
+
+    // Cases for statements ending in a right curly return early, avoiding the
+    // common semicolon insertion magic after this switch.
+    switch ($tt) {
+      case KEYWORD_FUNCTION:
+        return $this-&gt;FunctionDefinition(
 					$x,
 					true,
 					count($x-&gt;stmtStack) &gt; 1 ? STATEMENT_FORM : DECLARED_FORM
 				);
-			break;
+        break;
 
-			case OP_LEFT_CURLY:
-				$n = $this-&gt;Statements($x);
-				$this-&gt;t-&gt;mustMatch(OP_RIGHT_CURLY);
-			return $n;
-
-			case KEYWORD_IF:
-				$n = new JSNode($this-&gt;t);
-				$n-&gt;condition = $this-&gt;ParenExpression($x);
-				array_push($x-&gt;stmtStack, $n);
-				$n-&gt;thenPart = $this-&gt;Statement($x);
-				$n-&gt;elsePart = $this-&gt;t-&gt;match(KEYWORD_ELSE) ? $this-&gt;Statement($x) : null;
-				array_pop($x-&gt;stmtStack);
-			return $n;
-
-			case KEYWORD_SWITCH:
-				$n = new JSNode($this-&gt;t);
-				$this-&gt;t-&gt;mustMatch(OP_LEFT_PAREN);
-				$n-&gt;discriminant = $this-&gt;Expression($x);
-				$this-&gt;t-&gt;mustMatch(OP_RIGHT_PAREN);
-				$n-&gt;cases = array();
-				$n-&gt;defaultIndex = -1;
-
-				array_push($x-&gt;stmtStack, $n);
-
-				$this-&gt;t-&gt;mustMatch(OP_LEFT_CURLY);
-
-				while (($tt = $this-&gt;t-&gt;get()) != OP_RIGHT_CURLY)
-				{
-					switch ($tt)
-					{
-						case KEYWORD_DEFAULT:
-							if ($n-&gt;defaultIndex &gt;= 0)
-								throw $this-&gt;t-&gt;newSyntaxError(&#039;More than one switch default&#039;);
-							// FALL THROUGH
-						case KEYWORD_CASE:
-							$n2 = new JSNode($this-&gt;t);
-							if ($tt == KEYWORD_DEFAULT)
-								$n-&gt;defaultIndex = count($n-&gt;cases);
-							else
-								$n2-&gt;caseLabel = $this-&gt;Expression($x, OP_COLON);
-								break;
-						default:
-							throw $this-&gt;t-&gt;newSyntaxError(&#039;Invalid switch case&#039;);
-					}
-
-					$this-&gt;t-&gt;mustMatch(OP_COLON);
-					$n2-&gt;statements = new JSNode($this-&gt;t, JS_BLOCK);
-					while (($tt = $this-&gt;t-&gt;peek()) != KEYWORD_CASE &amp;&amp; $tt != KEYWORD_DEFAULT &amp;&amp; $tt != OP_RIGHT_CURLY)
-						$n2-&gt;statements-&gt;addNode($this-&gt;Statement($x));
-
-					array_push($n-&gt;cases, $n2);
-				}
-
-				array_pop($x-&gt;stmtStack);
-			return $n;
-
-			case KEYWORD_FOR:
-				$n = new JSNode($this-&gt;t);
-				$n-&gt;isLoop = true;
-				$this-&gt;t-&gt;mustMatch(OP_LEFT_PAREN);
-
-				if (($tt = $this-&gt;t-&gt;peek()) != OP_SEMICOLON)
-				{
-					$x-&gt;inForLoopInit = true;
-					if ($tt == KEYWORD_VAR || $tt == KEYWORD_CONST)
-					{
-						$this-&gt;t-&gt;get();
-						$n2 = $this-&gt;Variables($x);
-					}
-					else
-					{
-						$n2 = $this-&gt;Expression($x);
-					}
-					$x-&gt;inForLoopInit = false;
-				}
-
-				if ($n2 &amp;&amp; $this-&gt;t-&gt;match(KEYWORD_IN))
-				{
-					$n-&gt;type = JS_FOR_IN;
-					if ($n2-&gt;type == KEYWORD_VAR)
-					{
-						if (count($n2-&gt;treeNodes) != 1)
-						{
-							throw $this-&gt;t-&gt;SyntaxError(
+      case OP_LEFT_CURLY:
+        $n = $this-&gt;Statements($x);
+        $this-&gt;t-&gt;mustMatch(OP_RIGHT_CURLY);
+        return $n;
+
+      case KEYWORD_IF:
+        $n = new JSNode($this-&gt;t);
+        $n-&gt;condition = $this-&gt;ParenExpression($x);
+        array_push($x-&gt;stmtStack, $n);
+        $n-&gt;thenPart = $this-&gt;Statement($x);
+        $n-&gt;elsePart = $this-&gt;t-&gt;match(KEYWORD_ELSE) ? $this-&gt;Statement($x) : null;
+        array_pop($x-&gt;stmtStack);
+        return $n;
+
+      case KEYWORD_SWITCH:
+        $n = new JSNode($this-&gt;t);
+        $this-&gt;t-&gt;mustMatch(OP_LEFT_PAREN);
+        $n-&gt;discriminant = $this-&gt;Expression($x);
+        $this-&gt;t-&gt;mustMatch(OP_RIGHT_PAREN);
+        $n-&gt;cases = array();
+        $n-&gt;defaultIndex = -1;
+
+        array_push($x-&gt;stmtStack, $n);
+
+        $this-&gt;t-&gt;mustMatch(OP_LEFT_CURLY);
+
+        while (($tt = $this-&gt;t-&gt;get()) != OP_RIGHT_CURLY) {
+          switch ($tt) {
+            case KEYWORD_DEFAULT:
+              if ($n-&gt;defaultIndex &gt;= 0) {
+                throw $this-&gt;t-&gt;newSyntaxError(&#039;More than one switch default&#039;);
+              }
+              // FALL THROUGH
+            case KEYWORD_CASE:
+              $n2 = new JSNode($this-&gt;t);
+              if ($tt == KEYWORD_DEFAULT) {
+                $n-&gt;defaultIndex = count($n-&gt;cases);
+              }
+              else {
+                $n2-&gt;caseLabel = $this-&gt;Expression($x, OP_COLON);
+              }
+              break;
+            default:
+              throw $this-&gt;t-&gt;newSyntaxError(&#039;Invalid switch case&#039;);
+          }
+
+          $this-&gt;t-&gt;mustMatch(OP_COLON);
+          $n2-&gt;statements = new JSNode($this-&gt;t, JS_BLOCK);
+          while (($tt = $this-&gt;t-&gt;peek()) != KEYWORD_CASE &amp;&amp; $tt != KEYWORD_DEFAULT &amp;&amp; $tt != OP_RIGHT_CURLY) {
+            $n2-&gt;statements-&gt;addNode($this-&gt;Statement($x));
+          }
+
+          array_push($n-&gt;cases, $n2);
+        }
+
+        array_pop($x-&gt;stmtStack);
+        return $n;
+
+      case KEYWORD_FOR:
+        $n = new JSNode($this-&gt;t);
+        $n-&gt;isLoop = true;
+        $this-&gt;t-&gt;mustMatch(OP_LEFT_PAREN);
+
+        if (($tt = $this-&gt;t-&gt;peek()) != OP_SEMICOLON) {
+          $x-&gt;inForLoopInit = true;
+          if ($tt == KEYWORD_VAR || $tt == KEYWORD_CONST) {
+            $this-&gt;t-&gt;get();
+            $n2 = $this-&gt;Variables($x);
+          }
+          else {
+            $n2 = $this-&gt;Expression($x);
+          }
+          $x-&gt;inForLoopInit = false;
+        }
+
+        if ($n2 &amp;&amp; $this-&gt;t-&gt;match(KEYWORD_IN)) {
+          $n-&gt;type = JS_FOR_IN;
+          if ($n2-&gt;type == KEYWORD_VAR) {
+            if (count($n2-&gt;treeNodes) != 1) {
+              throw $this-&gt;t-&gt;SyntaxError(
 								&#039;Invalid for..in left-hand side&#039;,
 								$this-&gt;t-&gt;filename,
 								$n2-&gt;lineno
 							);
-						}
+            }
 
-						// NB: n2[0].type == IDENTIFIER and n2[0].value == n2[0].name.
-						$n-&gt;iterator = $n2-&gt;treeNodes[0];
-						$n-&gt;varDecl = $n2;
-					}
-					else
-					{
-						$n-&gt;iterator = $n2;
-						$n-&gt;varDecl = null;
-					}
-
-					$n-&gt;object = $this-&gt;Expression($x);
-				}
-				else
-				{
-					$n-&gt;setup = $n2 ? $n2 : null;
-					$this-&gt;t-&gt;mustMatch(OP_SEMICOLON);
-					$n-&gt;condition = $this-&gt;t-&gt;peek() == OP_SEMICOLON ? null : $this-&gt;Expression($x);
-					$this-&gt;t-&gt;mustMatch(OP_SEMICOLON);
-					$n-&gt;update = $this-&gt;t-&gt;peek() == OP_RIGHT_PAREN ? null : $this-&gt;Expression($x);
-				}
-
-				$this-&gt;t-&gt;mustMatch(OP_RIGHT_PAREN);
-				$n-&gt;body = $this-&gt;nest($x, $n);
-			return $n;
-
-			case KEYWORD_WHILE:
-			        $n = new JSNode($this-&gt;t);
-			        $n-&gt;isLoop = true;
-			        $n-&gt;condition = $this-&gt;ParenExpression($x);
-			        $n-&gt;body = $this-&gt;nest($x, $n);
-			return $n;
-
-			case KEYWORD_DO:
-				$n = new JSNode($this-&gt;t);
-				$n-&gt;isLoop = true;
-				$n-&gt;body = $this-&gt;nest($x, $n, KEYWORD_WHILE);
-				$n-&gt;condition = $this-&gt;ParenExpression($x);
-				if (!$x-&gt;ecmaStrictMode)
-				{
-					// &lt;script language=&quot;JavaScript&quot;&gt; (without version hints) may need
-					// automatic semicolon insertion without a newline after do-while.
-					// See http://bugzilla.mozilla.org/show_bug.cgi?id=238945.
-					$this-&gt;t-&gt;match(OP_SEMICOLON);
-					return $n;
-				}
-			break;
-
-			case KEYWORD_BREAK:
-			case KEYWORD_CONTINUE:
-				$n = new JSNode($this-&gt;t);
-
-				if ($this-&gt;t-&gt;peekOnSameLine() == TOKEN_IDENTIFIER)
-				{
-					$this-&gt;t-&gt;get();
-					$n-&gt;label = $this-&gt;t-&gt;currentToken()-&gt;value;
-				}
-
-				$ss = $x-&gt;stmtStack;
-				$i = count($ss);
-				$label = $n-&gt;label;
-				if ($label)
-				{
-					do
-					{
-						if (--$i &lt; 0)
-							throw $this-&gt;t-&gt;newSyntaxError(&#039;Label not found&#039;);
-					}
-					while ($ss[$i]-&gt;label != $label);
-				}
-				else
-				{
-					do
-					{
-						if (--$i &lt; 0)
-							throw $this-&gt;t-&gt;newSyntaxError(&#039;Invalid &#039; . $tt);
-					}
-					while (!$ss[$i]-&gt;isLoop &amp;&amp; ($tt != KEYWORD_BREAK || $ss[$i]-&gt;type != KEYWORD_SWITCH));
-				}
-
-				$n-&gt;target = $ss[$i];
-			break;
-
-			case KEYWORD_TRY:
-				$n = new JSNode($this-&gt;t);
-				$n-&gt;tryBlock = $this-&gt;Block($x);
-				$n-&gt;catchClauses = array();
-
-				while ($this-&gt;t-&gt;match(KEYWORD_CATCH))
-				{
-					$n2 = new JSNode($this-&gt;t);
-					$this-&gt;t-&gt;mustMatch(OP_LEFT_PAREN);
-					$n2-&gt;varName = $this-&gt;t-&gt;mustMatch(TOKEN_IDENTIFIER)-&gt;value;
-
-					if ($this-&gt;t-&gt;match(KEYWORD_IF))
-					{
-						if ($x-&gt;ecmaStrictMode)
-							throw $this-&gt;t-&gt;newSyntaxError(&#039;Illegal catch guard&#039;);
-
-						if (count($n-&gt;catchClauses) &amp;&amp; !end($n-&gt;catchClauses)-&gt;guard)
-							throw $this-&gt;t-&gt;newSyntaxError(&#039;Guarded catch after unguarded&#039;);
-
-						$n2-&gt;guard = $this-&gt;Expression($x);
-					}
-					else
-					{
-						$n2-&gt;guard = null;
-					}
-
-					$this-&gt;t-&gt;mustMatch(OP_RIGHT_PAREN);
-					$n2-&gt;block = $this-&gt;Block($x);
-					array_push($n-&gt;catchClauses, $n2);
-				}
-
-				if ($this-&gt;t-&gt;match(KEYWORD_FINALLY))
-					$n-&gt;finallyBlock = $this-&gt;Block($x);
-
-				if (!count($n-&gt;catchClauses) &amp;&amp; !$n-&gt;finallyBlock)
-					throw $this-&gt;t-&gt;newSyntaxError(&#039;Invalid try statement&#039;);
-			return $n;
-
-			case KEYWORD_CATCH:
-			case KEYWORD_FINALLY:
-				throw $this-&gt;t-&gt;newSyntaxError($tt + &#039; without preceding try&#039;);
-
-			case KEYWORD_THROW:
-				$n = new JSNode($this-&gt;t);
-				$n-&gt;value = $this-&gt;Expression($x);
-			break;
-
-			case KEYWORD_RETURN:
-				if (!$x-&gt;inFunction)
-					throw $this-&gt;t-&gt;newSyntaxError(&#039;Invalid return&#039;);
-
-				$n = new JSNode($this-&gt;t);
-				$tt = $this-&gt;t-&gt;peekOnSameLine();
-				if ($tt != TOKEN_END &amp;&amp; $tt != TOKEN_NEWLINE &amp;&amp; $tt != OP_SEMICOLON &amp;&amp; $tt != OP_RIGHT_CURLY)
-					$n-&gt;value = $this-&gt;Expression($x);
-				else
-					$n-&gt;value = null;
-			break;
-
-			case KEYWORD_WITH:
-				$n = new JSNode($this-&gt;t);
-				$n-&gt;object = $this-&gt;ParenExpression($x);
-				$n-&gt;body = $this-&gt;nest($x, $n);
-			return $n;
-
-			case KEYWORD_VAR:
-			case KEYWORD_CONST:
-			        $n = $this-&gt;Variables($x);
-			break;
-
-			case TOKEN_CONDCOMMENT_START:
-			case TOKEN_CONDCOMMENT_END:
-				$n = new JSNode($this-&gt;t);
-			return $n;
-
-			case KEYWORD_DEBUGGER:
-				$n = new JSNode($this-&gt;t);
-			break;
-
-			case TOKEN_NEWLINE:
-			case OP_SEMICOLON:
-				$n = new JSNode($this-&gt;t, OP_SEMICOLON);
-				$n-&gt;expression = null;
-			return $n;
-
-			default:
-				if ($tt == TOKEN_IDENTIFIER)
-				{
-					$this-&gt;t-&gt;scanOperand = false;
-					$tt = $this-&gt;t-&gt;peek();
-					$this-&gt;t-&gt;scanOperand = true;
-					if ($tt == OP_COLON)
-					{
-						$label = $this-&gt;t-&gt;currentToken()-&gt;value;
-						$ss = $x-&gt;stmtStack;
-						for ($i = count($ss) - 1; $i &gt;= 0; --$i)
-						{
-							if ($ss[$i]-&gt;label == $label)
-								throw $this-&gt;t-&gt;newSyntaxError(&#039;Duplicate label&#039;);
-						}
-
-						$this-&gt;t-&gt;get();
-						$n = new JSNode($this-&gt;t, JS_LABEL);
-						$n-&gt;label = $label;
-						$n-&gt;statement = $this-&gt;nest($x, $n);
-
-						return $n;
-					}
-				}
-
-				$n = new JSNode($this-&gt;t, OP_SEMICOLON);
-				$this-&gt;t-&gt;unget();
-				$n-&gt;expression = $this-&gt;Expression($x);
-				$n-&gt;end = $n-&gt;expression-&gt;end;
-			break;
-		}
-
-		if ($this-&gt;t-&gt;lineno == $this-&gt;t-&gt;currentToken()-&gt;lineno)
-		{
-			$tt = $this-&gt;t-&gt;peekOnSameLine();
-			if ($tt != TOKEN_END &amp;&amp; $tt != TOKEN_NEWLINE &amp;&amp; $tt != OP_SEMICOLON &amp;&amp; $tt != OP_RIGHT_CURLY)
-				throw $this-&gt;t-&gt;newSyntaxError(&#039;Missing ; before statement&#039;);
-		}
-
-		$this-&gt;t-&gt;match(OP_SEMICOLON);
-
-		return $n;
-	}
-
-	private function FunctionDefinition($x, $requireName, $functionForm)
-	{
-		$f = new JSNode($this-&gt;t);
-
-		if ($f-&gt;type != KEYWORD_FUNCTION)
-			$f-&gt;type = ($f-&gt;value == &#039;get&#039;) ? JS_GETTER : JS_SETTER;
-
-		if ($this-&gt;t-&gt;match(TOKEN_IDENTIFIER))
-			$f-&gt;name = $this-&gt;t-&gt;currentToken()-&gt;value;
-		elseif ($requireName)
-			throw $this-&gt;t-&gt;newSyntaxError(&#039;Missing function identifier&#039;);
-
-		$this-&gt;t-&gt;mustMatch(OP_LEFT_PAREN);
-			$f-&gt;params = array();
-
-		while (($tt = $this-&gt;t-&gt;get()) != OP_RIGHT_PAREN)
-		{
-			if ($tt != TOKEN_IDENTIFIER)
-				throw $this-&gt;t-&gt;newSyntaxError(&#039;Missing formal parameter&#039;);
-
-			array_push($f-&gt;params, $this-&gt;t-&gt;currentToken()-&gt;value);
-
-			if ($this-&gt;t-&gt;peek() != OP_RIGHT_PAREN)
-				$this-&gt;t-&gt;mustMatch(OP_COMMA);
-		}
-
-		$this-&gt;t-&gt;mustMatch(OP_LEFT_CURLY);
-
-		$x2 = new JSCompilerContext(true);
-		$f-&gt;body = $this-&gt;Script($x2);
-
-		$this-&gt;t-&gt;mustMatch(OP_RIGHT_CURLY);
-		$f-&gt;end = $this-&gt;t-&gt;currentToken()-&gt;end;
-
-		$f-&gt;functionForm = $functionForm;
-		if ($functionForm == DECLARED_FORM)
-			array_push($x-&gt;funDecls, $f);
-
-		return $f;
-	}
-
-	private function Variables($x)
-	{
-		$n = new JSNode($this-&gt;t);
-
-		do
-		{
-			$this-&gt;t-&gt;mustMatch(TOKEN_IDENTIFIER);
-
-			$n2 = new JSNode($this-&gt;t);
-			$n2-&gt;name = $n2-&gt;value;
-
-			if ($this-&gt;t-&gt;match(OP_ASSIGN))
-			{
-				if ($this-&gt;t-&gt;currentToken()-&gt;assignOp)
-					throw $this-&gt;t-&gt;newSyntaxError(&#039;Invalid variable initialization&#039;);
-
-				$n2-&gt;initializer = $this-&gt;Expression($x, OP_COMMA);
-			}
-
-			$n2-&gt;readOnly = $n-&gt;type == KEYWORD_CONST;
-
-			$n-&gt;addNode($n2);
-			array_push($x-&gt;varDecls, $n2);
-		}
-		while ($this-&gt;t-&gt;match(OP_COMMA));
-
-		return $n;
-	}
-
-	private function Expression($x, $stop=false)
-	{
-		$operators = array();
-		$operands = array();
-		$n = false;
-
-		$bl = $x-&gt;bracketLevel;
-		$cl = $x-&gt;curlyLevel;
-		$pl = $x-&gt;parenLevel;
-		$hl = $x-&gt;hookLevel;
-
-		while (($tt = $this-&gt;t-&gt;get()) != TOKEN_END)
-		{
-			if ($tt == $stop &amp;&amp;
+            // NB: n2[0].type == IDENTIFIER and n2[0].value == n2[0].name.
+            $n-&gt;iterator = $n2-&gt;treeNodes[0];
+            $n-&gt;varDecl = $n2;
+          }
+          else {
+            $n-&gt;iterator = $n2;
+            $n-&gt;varDecl = null;
+          }
+
+          $n-&gt;object = $this-&gt;Expression($x);
+        }
+        else {
+          $n-&gt;setup = $n2 ? $n2 : null;
+          $this-&gt;t-&gt;mustMatch(OP_SEMICOLON);
+          $n-&gt;condition = $this-&gt;t-&gt;peek() == OP_SEMICOLON ? null : $this-&gt;Expression($x);
+          $this-&gt;t-&gt;mustMatch(OP_SEMICOLON);
+          $n-&gt;update = $this-&gt;t-&gt;peek() == OP_RIGHT_PAREN ? null : $this-&gt;Expression($x);
+        }
+
+        $this-&gt;t-&gt;mustMatch(OP_RIGHT_PAREN);
+        $n-&gt;body = $this-&gt;nest($x, $n);
+        return $n;
+
+      case KEYWORD_WHILE:
+        $n = new JSNode($this-&gt;t);
+        $n-&gt;isLoop = true;
+        $n-&gt;condition = $this-&gt;ParenExpression($x);
+        $n-&gt;body = $this-&gt;nest($x, $n);
+        return $n;
+
+      case KEYWORD_DO:
+        $n = new JSNode($this-&gt;t);
+        $n-&gt;isLoop = true;
+        $n-&gt;body = $this-&gt;nest($x, $n, KEYWORD_WHILE);
+        $n-&gt;condition = $this-&gt;ParenExpression($x);
+        if (!$x-&gt;ecmaStrictMode) {
+          // &lt;script language=&quot;JavaScript&quot;&gt; (without version hints) may need
+          // automatic semicolon insertion without a newline after do-while.
+          // See http://bugzilla.mozilla.org/show_bug.cgi?id=238945.
+          $this-&gt;t-&gt;match(OP_SEMICOLON);
+          return $n;
+        }
+        break;
+
+      case KEYWORD_BREAK:
+      case KEYWORD_CONTINUE:
+        $n = new JSNode($this-&gt;t);
+
+        if ($this-&gt;t-&gt;peekOnSameLine() == TOKEN_IDENTIFIER) {
+          $this-&gt;t-&gt;get();
+          $n-&gt;label = $this-&gt;t-&gt;currentToken()-&gt;value;
+        }
+
+        $ss = $x-&gt;stmtStack;
+        $i = count($ss);
+        $label = $n-&gt;label;
+        if ($label) {
+          do {
+            if (--$i &lt; 0) {
+              throw $this-&gt;t-&gt;newSyntaxError(&#039;Label not found&#039;);
+            }
+          } while ($ss[$i]-&gt;label != $label);
+        }
+        else {
+          do {
+            if (--$i &lt; 0) {
+              throw $this-&gt;t-&gt;newSyntaxError(&#039;Invalid &#039; . $tt);
+            }
+          } while (!$ss[$i]-&gt;isLoop &amp;&amp; ($tt != KEYWORD_BREAK || $ss[$i]-&gt;type != KEYWORD_SWITCH));
+        }
+
+        $n-&gt;target = $ss[$i];
+        break;
+
+      case KEYWORD_TRY:
+        $n = new JSNode($this-&gt;t);
+        $n-&gt;tryBlock = $this-&gt;Block($x);
+        $n-&gt;catchClauses = array();
+
+        while ($this-&gt;t-&gt;match(KEYWORD_CATCH)) {
+          $n2 = new JSNode($this-&gt;t);
+          $this-&gt;t-&gt;mustMatch(OP_LEFT_PAREN);
+          $n2-&gt;varName = $this-&gt;t-&gt;mustMatch(TOKEN_IDENTIFIER)-&gt;value;
+
+          if ($this-&gt;t-&gt;match(KEYWORD_IF)) {
+            if ($x-&gt;ecmaStrictMode) {
+              throw $this-&gt;t-&gt;newSyntaxError(&#039;Illegal catch guard&#039;);
+            }
+
+            if (count($n-&gt;catchClauses) &amp;&amp; !end($n-&gt;catchClauses)-&gt;guard) {
+              throw $this-&gt;t-&gt;newSyntaxError(&#039;Guarded catch after unguarded&#039;);
+            }
+
+            $n2-&gt;guard = $this-&gt;Expression($x);
+          }
+          else {
+            $n2-&gt;guard = null;
+          }
+
+          $this-&gt;t-&gt;mustMatch(OP_RIGHT_PAREN);
+          $n2-&gt;block = $this-&gt;Block($x);
+          array_push($n-&gt;catchClauses, $n2);
+        }
+
+        if ($this-&gt;t-&gt;match(KEYWORD_FINALLY)) {
+          $n-&gt;finallyBlock = $this-&gt;Block($x);
+        }
+
+        if (!count($n-&gt;catchClauses) &amp;&amp; !$n-&gt;finallyBlock) {
+          throw $this-&gt;t-&gt;newSyntaxError(&#039;Invalid try statement&#039;);
+        }
+        return $n;
+
+      case KEYWORD_CATCH:
+      case KEYWORD_FINALLY:
+        throw $this-&gt;t-&gt;newSyntaxError($tt + &#039; without preceding try&#039;);
+
+      case KEYWORD_THROW:
+        $n = new JSNode($this-&gt;t);
+        $n-&gt;value = $this-&gt;Expression($x);
+        break;
+
+      case KEYWORD_RETURN:
+        if (!$x-&gt;inFunction) {
+          throw $this-&gt;t-&gt;newSyntaxError(&#039;Invalid return&#039;);
+        }
+
+        $n = new JSNode($this-&gt;t);
+        $tt = $this-&gt;t-&gt;peekOnSameLine();
+        if ($tt != TOKEN_END &amp;&amp; $tt != TOKEN_NEWLINE &amp;&amp; $tt != OP_SEMICOLON &amp;&amp; $tt != OP_RIGHT_CURLY) {
+          $n-&gt;value = $this-&gt;Expression($x);
+        }
+        else {
+          $n-&gt;value = null;
+        }
+        break;
+
+      case KEYWORD_WITH:
+        $n = new JSNode($this-&gt;t);
+        $n-&gt;object = $this-&gt;ParenExpression($x);
+        $n-&gt;body = $this-&gt;nest($x, $n);
+        return $n;
+
+      case KEYWORD_VAR:
+      case KEYWORD_CONST:
+        $n = $this-&gt;Variables($x);
+        break;
+
+      case TOKEN_CONDCOMMENT_START:
+      case TOKEN_CONDCOMMENT_END:
+        $n = new JSNode($this-&gt;t);
+        return $n;
+
+      case KEYWORD_DEBUGGER:
+        $n = new JSNode($this-&gt;t);
+        break;
+
+      case TOKEN_NEWLINE:
+      case OP_SEMICOLON:
+        $n = new JSNode($this-&gt;t, OP_SEMICOLON);
+        $n-&gt;expression = null;
+        return $n;
+
+      default:
+        if ($tt == TOKEN_IDENTIFIER) {
+          $this-&gt;t-&gt;scanOperand = false;
+          $tt = $this-&gt;t-&gt;peek();
+          $this-&gt;t-&gt;scanOperand = true;
+          if ($tt == OP_COLON) {
+            $label = $this-&gt;t-&gt;currentToken()-&gt;value;
+            $ss = $x-&gt;stmtStack;
+            for ($i = count($ss) - 1; $i &gt;= 0; --$i) {
+              if ($ss[$i]-&gt;label == $label) {
+                throw $this-&gt;t-&gt;newSyntaxError(&#039;Duplicate label&#039;);
+              }
+            }
+
+            $this-&gt;t-&gt;get();
+            $n = new JSNode($this-&gt;t, JS_LABEL);
+            $n-&gt;label = $label;
+            $n-&gt;statement = $this-&gt;nest($x, $n);
+
+            return $n;
+          }
+        }
+
+        $n = new JSNode($this-&gt;t, OP_SEMICOLON);
+        $this-&gt;t-&gt;unget();
+        $n-&gt;expression = $this-&gt;Expression($x);
+        $n-&gt;end = $n-&gt;expression-&gt;end;
+        break;
+    }
+
+    if ($this-&gt;t-&gt;lineno == $this-&gt;t-&gt;currentToken()-&gt;lineno) {
+      $tt = $this-&gt;t-&gt;peekOnSameLine();
+      if ($tt != TOKEN_END &amp;&amp; $tt != TOKEN_NEWLINE &amp;&amp; $tt != OP_SEMICOLON &amp;&amp; $tt != OP_RIGHT_CURLY) {
+        throw $this-&gt;t-&gt;newSyntaxError(&#039;Missing ; before statement&#039;);
+      }
+    }
+
+    $this-&gt;t-&gt;match(OP_SEMICOLON);
+
+    return $n;
+  }
+
+  private function FunctionDefinition($x, $requireName, $functionForm) {
+    $f = new JSNode($this-&gt;t);
+
+    if ($f-&gt;type != KEYWORD_FUNCTION) {
+      $f-&gt;type = ($f-&gt;value == &#039;get&#039;) ? JS_GETTER : JS_SETTER;
+    }
+
+    if ($this-&gt;t-&gt;match(TOKEN_IDENTIFIER)) {
+      $f-&gt;name = $this-&gt;t-&gt;currentToken()-&gt;value;
+    }
+    elseif ($requireName) {
+      throw $this-&gt;t-&gt;newSyntaxError(&#039;Missing function identifier&#039;);
+    }
+
+    $this-&gt;t-&gt;mustMatch(OP_LEFT_PAREN);
+    $f-&gt;params = array();
+
+    while (($tt = $this-&gt;t-&gt;get()) != OP_RIGHT_PAREN) {
+      if ($tt != TOKEN_IDENTIFIER) {
+        throw $this-&gt;t-&gt;newSyntaxError(&#039;Missing formal parameter&#039;);
+      }
+
+      array_push($f-&gt;params, $this-&gt;t-&gt;currentToken()-&gt;value);
+
+      if ($this-&gt;t-&gt;peek() != OP_RIGHT_PAREN) {
+        $this-&gt;t-&gt;mustMatch(OP_COMMA);
+      }
+    }
+
+    $this-&gt;t-&gt;mustMatch(OP_LEFT_CURLY);
+
+    $x2 = new JSCompilerContext(true);
+    $f-&gt;body = $this-&gt;Script($x2);
+
+    $this-&gt;t-&gt;mustMatch(OP_RIGHT_CURLY);
+    $f-&gt;end = $this-&gt;t-&gt;currentToken()-&gt;end;
+
+    $f-&gt;functionForm = $functionForm;
+    if ($functionForm == DECLARED_FORM) {
+      array_push($x-&gt;funDecls, $f);
+    }
+
+    return $f;
+  }
+
+  private function Variables($x) {
+    $n = new JSNode($this-&gt;t);
+
+    do {
+      $this-&gt;t-&gt;mustMatch(TOKEN_IDENTIFIER);
+
+      $n2 = new JSNode($this-&gt;t);
+      $n2-&gt;name = $n2-&gt;value;
+
+      if ($this-&gt;t-&gt;match(OP_ASSIGN)) {
+        if ($this-&gt;t-&gt;currentToken()-&gt;assignOp) {
+          throw $this-&gt;t-&gt;newSyntaxError(&#039;Invalid variable initialization&#039;);
+        }
+
+        $n2-&gt;initializer = $this-&gt;Expression($x, OP_COMMA);
+      }
+
+      $n2-&gt;readOnly = $n-&gt;type == KEYWORD_CONST;
+
+      $n-&gt;addNode($n2);
+      array_push($x-&gt;varDecls, $n2);
+    } while ($this-&gt;t-&gt;match(OP_COMMA));
+
+    return $n;
+  }
+
+  private function Expression($x, $stop = false) {
+    $operators = array();
+    $operands = array();
+    $n = false;
+
+    $bl = $x-&gt;bracketLevel;
+    $cl = $x-&gt;curlyLevel;
+    $pl = $x-&gt;parenLevel;
+    $hl = $x-&gt;hookLevel;
+
+    while (($tt = $this-&gt;t-&gt;get()) != TOKEN_END) {
+      if ($tt == $stop &amp;&amp;
 				$x-&gt;bracketLevel == $bl &amp;&amp;
 				$x-&gt;curlyLevel == $cl &amp;&amp;
 				$x-&gt;parenLevel == $pl &amp;&amp;
 				$x-&gt;hookLevel == $hl
-			)
-			{
-				// Stop only if tt matches the optional stop parameter, and that
-				// token is not quoted by some kind of bracket.
-				break;
-			}
-
-			switch ($tt)
-			{
-				case OP_SEMICOLON:
-					// NB: cannot be empty, Statement handled that.
-					break 2;
-
-				case OP_HOOK:
-					if ($this-&gt;t-&gt;scanOperand)
-						break 2;
+			) {
+        // Stop only if tt matches the optional stop parameter, and that
+        // token is not quoted by some kind of bracket.
+        break;
+      }
+
+      switch ($tt) {
+        case OP_SEMICOLON:
+          // NB: cannot be empty, Statement handled that.
+          break 2;
+
+        case OP_HOOK:
+          if ($this-&gt;t-&gt;scanOperand) {
+            break 2;
+          }
 
-					while (	!empty($operators) &amp;&amp;
+          while (	!empty($operators) &amp;&amp;
 						$this-&gt;opPrecedence[end($operators)-&gt;type] &gt; $this-&gt;opPrecedence[$tt]
-					)
-						$this-&gt;reduce($operators, $operands);
-
-					array_push($operators, new JSNode($this-&gt;t));
-
-					++$x-&gt;hookLevel;
-					$this-&gt;t-&gt;scanOperand = true;
-					$n = $this-&gt;Expression($x);
-
-					if (!$this-&gt;t-&gt;match(OP_COLON))
-						break 2;
-
-					--$x-&gt;hookLevel;
-					array_push($operands, $n);
-				break;
-
-				case OP_COLON:
-					if ($x-&gt;hookLevel)
-						break 2;
+					) {
+            $this-&gt;reduce($operators, $operands);
+          }
+
+          array_push($operators, new JSNode($this-&gt;t));
+
+          ++$x-&gt;hookLevel;
+          $this-&gt;t-&gt;scanOperand = true;
+          $n = $this-&gt;Expression($x);
+
+          if (!$this-&gt;t-&gt;match(OP_COLON)) {
+            break 2;
+          }
+
+          --$x-&gt;hookLevel;
+          array_push($operands, $n);
+          break;
+
+        case OP_COLON:
+          if ($x-&gt;hookLevel) {
+            break 2;
+          }
+
+          throw $this-&gt;t-&gt;newSyntaxError(&#039;Invalid label&#039;);
+          break;
+
+        case OP_ASSIGN:
+          if ($this-&gt;t-&gt;scanOperand) {
+            break 2;
+          }
 
-					throw $this-&gt;t-&gt;newSyntaxError(&#039;Invalid label&#039;);
-				break;
-
-				case OP_ASSIGN:
-					if ($this-&gt;t-&gt;scanOperand)
-						break 2;
-
-					// Use &gt;, not &gt;=, for right-associative ASSIGN
-					while (	!empty($operators) &amp;&amp;
+          // Use &gt;, not &gt;=, for right-associative ASSIGN
+          while (	!empty($operators) &amp;&amp;
 						$this-&gt;opPrecedence[end($operators)-&gt;type] &gt; $this-&gt;opPrecedence[$tt]
-					)
-						$this-&gt;reduce($operators, $operands);
-
-					array_push($operators, new JSNode($this-&gt;t));
-					end($operands)-&gt;assignOp = $this-&gt;t-&gt;currentToken()-&gt;assignOp;
-					$this-&gt;t-&gt;scanOperand = true;
-				break;
-
-				case KEYWORD_IN:
-					// An in operator should not be parsed if we&#039;re parsing the head of
-					// a for (...) loop, unless it is in the then part of a conditional
-					// expression, or parenthesized somehow.
-					if ($x-&gt;inForLoopInit &amp;&amp; !$x-&gt;hookLevel &amp;&amp;
+					) {
+            $this-&gt;reduce($operators, $operands);
+          }
+
+          array_push($operators, new JSNode($this-&gt;t));
+          end($operands)-&gt;assignOp = $this-&gt;t-&gt;currentToken()-&gt;assignOp;
+          $this-&gt;t-&gt;scanOperand = true;
+          break;
+
+        case KEYWORD_IN:
+          // An in operator should not be parsed if we&#039;re parsing the head of
+          // a for (...) loop, unless it is in the then part of a conditional
+          // expression, or parenthesized somehow.
+          if ($x-&gt;inForLoopInit &amp;&amp; !$x-&gt;hookLevel &amp;&amp;
 						!$x-&gt;bracketLevel &amp;&amp; !$x-&gt;curlyLevel &amp;&amp;
 						!$x-&gt;parenLevel
-					)
-						break 2;
-				// FALL THROUGH
-				case OP_COMMA:
-					// A comma operator should not be parsed if we&#039;re parsing the then part
-					// of a conditional expression unless it&#039;s parenthesized somehow.
-					if ($tt == OP_COMMA &amp;&amp; $x-&gt;hookLevel &amp;&amp;
+					) {
+            break 2;
+          }
+          // FALL THROUGH
+        case OP_COMMA:
+          // A comma operator should not be parsed if we&#039;re parsing the then part
+          // of a conditional expression unless it&#039;s parenthesized somehow.
+          if ($tt == OP_COMMA &amp;&amp; $x-&gt;hookLevel &amp;&amp;
 						!$x-&gt;bracketLevel &amp;&amp; !$x-&gt;curlyLevel &amp;&amp;
 						!$x-&gt;parenLevel
-					)
-						break 2;
-				// Treat comma as left-associative so reduce can fold left-heavy
-				// COMMA trees into a single array.
-				// FALL THROUGH
-				case OP_OR:
-				case OP_AND:
-				case OP_BITWISE_OR:
-				case OP_BITWISE_XOR:
-				case OP_BITWISE_AND:
-				case OP_EQ: case OP_NE: case OP_STRICT_EQ: case OP_STRICT_NE:
-				case OP_LT: case OP_LE: case OP_GE: case OP_GT:
-				case KEYWORD_INSTANCEOF:
-				case OP_LSH: case OP_RSH: case OP_URSH:
-				case OP_PLUS: case OP_MINUS:
-				case OP_MUL: case OP_DIV: case OP_MOD:
-				case OP_DOT:
-					if ($this-&gt;t-&gt;scanOperand)
-						break 2;
+					) {
+            break 2;
+          }
+          // Treat comma as left-associative so reduce can fold left-heavy
+          // COMMA trees into a single array.
+          // FALL THROUGH
+        case OP_OR:
+        case OP_AND:
+        case OP_BITWISE_OR:
+        case OP_BITWISE_XOR:
+        case OP_BITWISE_AND:
+        case OP_EQ:
+        case OP_NE:
+        case OP_STRICT_EQ:
+        case OP_STRICT_NE:
+        case OP_LT:
+        case OP_LE:
+        case OP_GE:
+        case OP_GT:
+        case KEYWORD_INSTANCEOF:
+        case OP_LSH:
+        case OP_RSH:
+        case OP_URSH:
+        case OP_PLUS:
+        case OP_MINUS:
+        case OP_MUL:
+        case OP_DIV:
+        case OP_MOD:
+        case OP_DOT:
+          if ($this-&gt;t-&gt;scanOperand) {
+            break 2;
+          }
 
-					while (	!empty($operators) &amp;&amp;
+          while (	!empty($operators) &amp;&amp;
 						$this-&gt;opPrecedence[end($operators)-&gt;type] &gt;= $this-&gt;opPrecedence[$tt]
-					)
-						$this-&gt;reduce($operators, $operands);
-
-					if ($tt == OP_DOT)
-					{
-						$this-&gt;t-&gt;mustMatch(TOKEN_IDENTIFIER);
-						array_push($operands, new JSNode($this-&gt;t, OP_DOT, array_pop($operands), new JSNode($this-&gt;t)));
-					}
-					else
-					{
-						array_push($operators, new JSNode($this-&gt;t));
-						$this-&gt;t-&gt;scanOperand = true;
-					}
-				break;
-
-				case KEYWORD_DELETE: case KEYWORD_VOID: case KEYWORD_TYPEOF:
-				case OP_NOT: case OP_BITWISE_NOT: case OP_UNARY_PLUS: case OP_UNARY_MINUS:
-				case KEYWORD_NEW:
-					if (!$this-&gt;t-&gt;scanOperand)
-						break 2;
-
-					array_push($operators, new JSNode($this-&gt;t));
-				break;
-
-				case OP_INCREMENT: case OP_DECREMENT:
-					if ($this-&gt;t-&gt;scanOperand)
-					{
-						array_push($operators, new JSNode($this-&gt;t));  // prefix increment or decrement
-					}
-					else
-					{
-						// Don&#039;t cross a line boundary for postfix {in,de}crement.
-						$t = $this-&gt;t-&gt;tokens[($this-&gt;t-&gt;tokenIndex + $this-&gt;t-&gt;lookahead - 1) &amp; 3];
-						if ($t &amp;&amp; $t-&gt;lineno != $this-&gt;t-&gt;lineno)
-							break 2;
-
-						if (!empty($operators))
-						{
-							// Use &gt;, not &gt;=, so postfix has higher precedence than prefix.
-							while ($this-&gt;opPrecedence[end($operators)-&gt;type] &gt; $this-&gt;opPrecedence[$tt])
-								$this-&gt;reduce($operators, $operands);
-						}
-
-						$n = new JSNode($this-&gt;t, $tt, array_pop($operands));
-						$n-&gt;postfix = true;
-						array_push($operands, $n);
-					}
-				break;
-
-				case KEYWORD_FUNCTION:
-					if (!$this-&gt;t-&gt;scanOperand)
-						break 2;
-
-					array_push($operands, $this-&gt;FunctionDefinition($x, false, EXPRESSED_FORM));
-					$this-&gt;t-&gt;scanOperand = false;
-				break;
-
-				case KEYWORD_NULL: case KEYWORD_THIS: case KEYWORD_TRUE: case KEYWORD_FALSE:
-				case TOKEN_IDENTIFIER: case TOKEN_NUMBER: case TOKEN_STRING: case TOKEN_REGEXP:
-					if (!$this-&gt;t-&gt;scanOperand)
-						break 2;
-
-					array_push($operands, new JSNode($this-&gt;t));
-					$this-&gt;t-&gt;scanOperand = false;
-				break;
-
-				case TOKEN_CONDCOMMENT_START:
-				case TOKEN_CONDCOMMENT_END:
-					if ($this-&gt;t-&gt;scanOperand)
-						array_push($operators, new JSNode($this-&gt;t));
-					else
-						array_push($operands, new JSNode($this-&gt;t));
-				break;
-
-				case OP_LEFT_BRACKET:
-					if ($this-&gt;t-&gt;scanOperand)
-					{
-						// Array initialiser.  Parse using recursive descent, as the
-						// sub-grammar here is not an operator grammar.
-						$n = new JSNode($this-&gt;t, JS_ARRAY_INIT);
-						while (($tt = $this-&gt;t-&gt;peek()) != OP_RIGHT_BRACKET)
-						{
-							if ($tt == OP_COMMA)
-							{
-								$this-&gt;t-&gt;get();
-								$n-&gt;addNode(null);
-								continue;
-							}
-
-							$n-&gt;addNode($this-&gt;Expression($x, OP_COMMA));
-							if (!$this-&gt;t-&gt;match(OP_COMMA))
-								break;
-						}
-
-						$this-&gt;t-&gt;mustMatch(OP_RIGHT_BRACKET);
-						array_push($operands, $n);
-						$this-&gt;t-&gt;scanOperand = false;
-					}
-					else
-					{
-						// Property indexing operator.
-						array_push($operators, new JSNode($this-&gt;t, JS_INDEX));
-						$this-&gt;t-&gt;scanOperand = true;
-						++$x-&gt;bracketLevel;
-					}
-				break;
-
-				case OP_RIGHT_BRACKET:
-					if ($this-&gt;t-&gt;scanOperand || $x-&gt;bracketLevel == $bl)
-						break 2;
-
-					while ($this-&gt;reduce($operators, $operands)-&gt;type != JS_INDEX)
-						continue;
-
-					--$x-&gt;bracketLevel;
-				break;
-
-				case OP_LEFT_CURLY:
-					if (!$this-&gt;t-&gt;scanOperand)
-						break 2;
-
-					// Object initialiser.  As for array initialisers (see above),
-					// parse using recursive descent.
-					++$x-&gt;curlyLevel;
-					$n = new JSNode($this-&gt;t, JS_OBJECT_INIT);
-					while (!$this-&gt;t-&gt;match(OP_RIGHT_CURLY))
-					{
-						do
-						{
-							$tt = $this-&gt;t-&gt;get();
-							$tv = $this-&gt;t-&gt;currentToken()-&gt;value;
-							if (($tv == &#039;get&#039; || $tv == &#039;set&#039;) &amp;&amp; $this-&gt;t-&gt;peek() == TOKEN_IDENTIFIER)
-							{
-								if ($x-&gt;ecmaStrictMode)
-									throw $this-&gt;t-&gt;newSyntaxError(&#039;Illegal property accessor&#039;);
-
-								$n-&gt;addNode($this-&gt;FunctionDefinition($x, true, EXPRESSED_FORM));
-							}
-							else
-							{
-								switch ($tt)
-								{
-									case TOKEN_IDENTIFIER:
-									case TOKEN_NUMBER:
-									case TOKEN_STRING:
-										$id = new JSNode($this-&gt;t);
-									break;
-
-									case OP_RIGHT_CURLY:
-										if ($x-&gt;ecmaStrictMode)
-											throw $this-&gt;t-&gt;newSyntaxError(&#039;Illegal trailing ,&#039;);
-									break 3;
-
-									default:
-										throw $this-&gt;t-&gt;newSyntaxError(&#039;Invalid property name&#039;);
-								}
-
-								$this-&gt;t-&gt;mustMatch(OP_COLON);
-								$n-&gt;addNode(new JSNode($this-&gt;t, JS_PROPERTY_INIT, $id, $this-&gt;Expression($x, OP_COMMA)));
-							}
-						}
-						while ($this-&gt;t-&gt;match(OP_COMMA));
-
-						$this-&gt;t-&gt;mustMatch(OP_RIGHT_CURLY);
-						break;
-					}
-
-					array_push($operands, $n);
-					$this-&gt;t-&gt;scanOperand = false;
-					--$x-&gt;curlyLevel;
-				break;
-
-				case OP_RIGHT_CURLY:
-					if (!$this-&gt;t-&gt;scanOperand &amp;&amp; $x-&gt;curlyLevel != $cl)
-						throw new Exception(&#039;PANIC: right curly botch&#039;);
-				break 2;
-
-				case OP_LEFT_PAREN:
-					if ($this-&gt;t-&gt;scanOperand)
-					{
-						array_push($operators, new JSNode($this-&gt;t, JS_GROUP));
-					}
-					else
-					{
-						while (	!empty($operators) &amp;&amp;
+					) {
+            $this-&gt;reduce($operators, $operands);
+          }
+
+          if ($tt == OP_DOT) {
+            $this-&gt;t-&gt;mustMatch(TOKEN_IDENTIFIER);
+            array_push($operands, new JSNode($this-&gt;t, OP_DOT, array_pop($operands), new JSNode($this-&gt;t)));
+          }
+          else {
+            array_push($operators, new JSNode($this-&gt;t));
+            $this-&gt;t-&gt;scanOperand = true;
+          }
+          break;
+
+        case KEYWORD_DELETE:
+        case KEYWORD_VOID:
+        case KEYWORD_TYPEOF:
+        case OP_NOT:
+        case OP_BITWISE_NOT:
+        case OP_UNARY_PLUS:
+        case OP_UNARY_MINUS:
+        case KEYWORD_NEW:
+          if (!$this-&gt;t-&gt;scanOperand) {
+            break 2;
+          }
+
+          array_push($operators, new JSNode($this-&gt;t));
+          break;
+
+        case OP_INCREMENT:
+        case OP_DECREMENT:
+          if ($this-&gt;t-&gt;scanOperand) {
+            array_push($operators, new JSNode($this-&gt;t)); // prefix increment or decrement
+          }
+          else {
+            // Don&#039;t cross a line boundary for postfix {in,de}crement.
+            $t = $this-&gt;t-&gt;tokens[($this-&gt;t-&gt;tokenIndex + $this-&gt;t-&gt;lookahead - 1) &amp; 3];
+            if ($t &amp;&amp; $t-&gt;lineno != $this-&gt;t-&gt;lineno) {
+              break 2;
+            }
+
+            if (!empty($operators)) {
+              // Use &gt;, not &gt;=, so postfix has higher precedence than prefix.
+              while ($this-&gt;opPrecedence[end($operators)-&gt;type] &gt; $this-&gt;opPrecedence[$tt]) {
+                $this-&gt;reduce($operators, $operands);
+              }
+            }
+
+            $n = new JSNode($this-&gt;t, $tt, array_pop($operands));
+            $n-&gt;postfix = true;
+            array_push($operands, $n);
+          }
+          break;
+
+        case KEYWORD_FUNCTION:
+          if (!$this-&gt;t-&gt;scanOperand) {
+            break 2;
+          }
+
+          array_push($operands, $this-&gt;FunctionDefinition($x, false, EXPRESSED_FORM));
+          $this-&gt;t-&gt;scanOperand = false;
+          break;
+
+        case KEYWORD_NULL:
+        case KEYWORD_THIS:
+        case KEYWORD_TRUE:
+        case KEYWORD_FALSE:
+        case TOKEN_IDENTIFIER:
+        case TOKEN_NUMBER:
+        case TOKEN_STRING:
+        case TOKEN_REGEXP:
+          if (!$this-&gt;t-&gt;scanOperand) {
+            break 2;
+          }
+
+          array_push($operands, new JSNode($this-&gt;t));
+          $this-&gt;t-&gt;scanOperand = false;
+          break;
+
+        case TOKEN_CONDCOMMENT_START:
+        case TOKEN_CONDCOMMENT_END:
+          if ($this-&gt;t-&gt;scanOperand) {
+            array_push($operators, new JSNode($this-&gt;t));
+          }
+          else {
+            array_push($operands, new JSNode($this-&gt;t));
+          }
+          break;
+
+        case OP_LEFT_BRACKET:
+          if ($this-&gt;t-&gt;scanOperand) {
+            // Array initialiser.  Parse using recursive descent, as the
+            // sub-grammar here is not an operator grammar.
+            $n = new JSNode($this-&gt;t, JS_ARRAY_INIT);
+            while (($tt = $this-&gt;t-&gt;peek()) != OP_RIGHT_BRACKET) {
+              if ($tt == OP_COMMA) {
+                $this-&gt;t-&gt;get();
+                $n-&gt;addNode(null);
+                continue;
+              }
+
+              $n-&gt;addNode($this-&gt;Expression($x, OP_COMMA));
+              if (!$this-&gt;t-&gt;match(OP_COMMA)) {
+                break;
+              }
+            }
+
+            $this-&gt;t-&gt;mustMatch(OP_RIGHT_BRACKET);
+            array_push($operands, $n);
+            $this-&gt;t-&gt;scanOperand = false;
+          }
+          else {
+            // Property indexing operator.
+            array_push($operators, new JSNode($this-&gt;t, JS_INDEX));
+            $this-&gt;t-&gt;scanOperand = true;
+            ++$x-&gt;bracketLevel;
+          }
+          break;
+
+        case OP_RIGHT_BRACKET:
+          if ($this-&gt;t-&gt;scanOperand || $x-&gt;bracketLevel == $bl) {
+            break 2;
+          }
+
+          while ($this-&gt;reduce($operators, $operands)-&gt;type != JS_INDEX) {
+            continue;
+          }
+
+          --$x-&gt;bracketLevel;
+          break;
+
+        case OP_LEFT_CURLY:
+          if (!$this-&gt;t-&gt;scanOperand) {
+            break 2;
+          }
+
+          // Object initialiser.  As for array initialisers (see above),
+          // parse using recursive descent.
+          ++$x-&gt;curlyLevel;
+          $n = new JSNode($this-&gt;t, JS_OBJECT_INIT);
+          while (!$this-&gt;t-&gt;match(OP_RIGHT_CURLY)) {
+            do {
+              $tt = $this-&gt;t-&gt;get();
+              $tv = $this-&gt;t-&gt;currentToken()-&gt;value;
+              if (($tv == &#039;get&#039; || $tv == &#039;set&#039;) &amp;&amp; $this-&gt;t-&gt;peek() == TOKEN_IDENTIFIER) {
+                if ($x-&gt;ecmaStrictMode) {
+                  throw $this-&gt;t-&gt;newSyntaxError(&#039;Illegal property accessor&#039;);
+                }
+
+                $n-&gt;addNode($this-&gt;FunctionDefinition($x, true, EXPRESSED_FORM));
+              }
+              else {
+                switch ($tt) {
+                  case TOKEN_IDENTIFIER:
+                  case TOKEN_NUMBER:
+                  case TOKEN_STRING:
+                    $id = new JSNode($this-&gt;t);
+                    break;
+
+                  case OP_RIGHT_CURLY:
+                    if ($x-&gt;ecmaStrictMode) {
+                      throw $this-&gt;t-&gt;newSyntaxError(&#039;Illegal trailing ,&#039;);
+                    }
+                    break 3;
+
+                  default:
+                    throw $this-&gt;t-&gt;newSyntaxError(&#039;Invalid property name&#039;);
+                }
+
+                $this-&gt;t-&gt;mustMatch(OP_COLON);
+                $n-&gt;addNode(new JSNode($this-&gt;t, JS_PROPERTY_INIT, $id, $this-&gt;Expression($x, OP_COMMA)));
+              }
+            } while ($this-&gt;t-&gt;match(OP_COMMA));
+
+            $this-&gt;t-&gt;mustMatch(OP_RIGHT_CURLY);
+            break;
+          }
+
+          array_push($operands, $n);
+          $this-&gt;t-&gt;scanOperand = false;
+          --$x-&gt;curlyLevel;
+          break;
+
+        case OP_RIGHT_CURLY:
+          if (!$this-&gt;t-&gt;scanOperand &amp;&amp; $x-&gt;curlyLevel != $cl) {
+            throw new Exception(&#039;PANIC: right curly botch&#039;);
+          }
+          break 2;
+
+        case OP_LEFT_PAREN:
+          if ($this-&gt;t-&gt;scanOperand) {
+            array_push($operators, new JSNode($this-&gt;t, JS_GROUP));
+          }
+          else {
+            while (	!empty($operators) &amp;&amp;
 							$this-&gt;opPrecedence[end($operators)-&gt;type] &gt; $this-&gt;opPrecedence[KEYWORD_NEW]
-						)
-							$this-&gt;reduce($operators, $operands);
-
-						// Handle () now, to regularize the n-ary case for n &gt; 0.
-						// We must set scanOperand in case there are arguments and
-						// the first one is a regexp or unary+/-.
-						$n = end($operators);
-						$this-&gt;t-&gt;scanOperand = true;
-						if ($this-&gt;t-&gt;match(OP_RIGHT_PAREN))
-						{
-							if ($n &amp;&amp; $n-&gt;type == KEYWORD_NEW)
-							{
-								array_pop($operators);
-								$n-&gt;addNode(array_pop($operands));
-							}
-							else
-							{
-								$n = new JSNode($this-&gt;t, JS_CALL, array_pop($operands), new JSNode($this-&gt;t, JS_LIST));
-							}
-
-							array_push($operands, $n);
-							$this-&gt;t-&gt;scanOperand = false;
-							break;
-						}
-
-						if ($n &amp;&amp; $n-&gt;type == KEYWORD_NEW)
-							$n-&gt;type = JS_NEW_WITH_ARGS;
-						else
-							array_push($operators, new JSNode($this-&gt;t, JS_CALL));
-					}
-
-					++$x-&gt;parenLevel;
-				break;
-
-				case OP_RIGHT_PAREN:
-					if ($this-&gt;t-&gt;scanOperand || $x-&gt;parenLevel == $pl)
-						break 2;
+						) {
+              $this-&gt;reduce($operators, $operands);
+            }
+
+            // Handle () now, to regularize the n-ary case for n &gt; 0.
+            // We must set scanOperand in case there are arguments and
+            // the first one is a regexp or unary+/-.
+            $n = end($operators);
+            $this-&gt;t-&gt;scanOperand = true;
+            if ($this-&gt;t-&gt;match(OP_RIGHT_PAREN)) {
+              if ($n &amp;&amp; $n-&gt;type == KEYWORD_NEW) {
+                array_pop($operators);
+                $n-&gt;addNode(array_pop($operands));
+              }
+              else {
+                $n = new JSNode($this-&gt;t, JS_CALL, array_pop($operands), new JSNode($this-&gt;t, JS_LIST));
+              }
+
+              array_push($operands, $n);
+              $this-&gt;t-&gt;scanOperand = false;
+              break;
+            }
+
+            if ($n &amp;&amp; $n-&gt;type == KEYWORD_NEW) {
+              $n-&gt;type = JS_NEW_WITH_ARGS;
+            }
+            else {
+              array_push($operators, new JSNode($this-&gt;t, JS_CALL));
+            }
+          }
+
+          ++$x-&gt;parenLevel;
+          break;
+
+        case OP_RIGHT_PAREN:
+          if ($this-&gt;t-&gt;scanOperand || $x-&gt;parenLevel == $pl) {
+            break 2;
+          }
 
-					while (($tt = $this-&gt;reduce($operators, $operands)-&gt;type) != JS_GROUP &amp;&amp;
+          while (($tt = $this-&gt;reduce($operators, $operands)-&gt;type) != JS_GROUP &amp;&amp;
 						$tt != JS_CALL &amp;&amp; $tt != JS_NEW_WITH_ARGS
-					)
-					{
-						continue;
-					}
-
-					if ($tt != JS_GROUP)
-					{
-						$n = end($operands);
-						if ($n-&gt;treeNodes[1]-&gt;type != OP_COMMA)
-							$n-&gt;treeNodes[1] = new JSNode($this-&gt;t, JS_LIST, $n-&gt;treeNodes[1]);
-						else
-							$n-&gt;treeNodes[1]-&gt;type = JS_LIST;
-					}
-
-					--$x-&gt;parenLevel;
-				break;
-
-				// Automatic semicolon insertion means we may scan across a newline
-				// and into the beginning of another statement.  If so, break out of
-				// the while loop and let the t.scanOperand logic handle errors.
-				default:
-					break 2;
-			}
-		}
-
-		if ($x-&gt;hookLevel != $hl)
-			throw $this-&gt;t-&gt;newSyntaxError(&#039;Missing : in conditional expression&#039;);
-
-		if ($x-&gt;parenLevel != $pl)
-			throw $this-&gt;t-&gt;newSyntaxError(&#039;Missing ) in parenthetical&#039;);
-
-		if ($x-&gt;bracketLevel != $bl)
-			throw $this-&gt;t-&gt;newSyntaxError(&#039;Missing ] in index expression&#039;);
-
-		if ($this-&gt;t-&gt;scanOperand)
-			throw $this-&gt;t-&gt;newSyntaxError(&#039;Missing operand&#039;);
-
-		// Resume default mode, scanning for operands, not operators.
-		$this-&gt;t-&gt;scanOperand = true;
-		$this-&gt;t-&gt;unget();
-
-		while (count($operators))
-			$this-&gt;reduce($operators, $operands);
-
-		return array_pop($operands);
-	}
-
-	private function ParenExpression($x)
-	{
-		$this-&gt;t-&gt;mustMatch(OP_LEFT_PAREN);
-		$n = $this-&gt;Expression($x);
-		$this-&gt;t-&gt;mustMatch(OP_RIGHT_PAREN);
-
-		return $n;
-	}
-
-	// Statement stack and nested statement handler.
-	private function nest($x, $node, $end = false)
-	{
-		array_push($x-&gt;stmtStack, $node);
-		$n = $this-&gt;statement($x);
-		array_pop($x-&gt;stmtStack);
-
-		if ($end)
-			$this-&gt;t-&gt;mustMatch($end);
-
-		return $n;
-	}
-
-	private function reduce(&amp;$operators, &amp;$operands)
-	{
-		$n = array_pop($operators);
-		$op = $n-&gt;type;
-		$arity = $this-&gt;opArity[$op];
-		$c = count($operands);
-		if ($arity == -2)
-		{
-			// Flatten left-associative trees
-			if ($c &gt;= 2)
-			{
-				$left = $operands[$c - 2];
-				if ($left-&gt;type == $op)
-				{
-					$right = array_pop($operands);
-					$left-&gt;addNode($right);
-					return $left;
-				}
-			}
-			$arity = 2;
-		}
-
-		// Always use push to add operands to n, to update start and end
-		$a = array_splice($operands, $c - $arity);
-		for ($i = 0; $i &lt; $arity; $i++)
-			$n-&gt;addNode($a[$i]);
-
-		// Include closing bracket or postfix operator in [start,end]
-		$te = $this-&gt;t-&gt;currentToken()-&gt;end;
-		if ($n-&gt;end &lt; $te)
-			$n-&gt;end = $te;
+					) {
+            continue;
+          }
+
+          if ($tt != JS_GROUP) {
+            $n = end($operands);
+            if ($n-&gt;treeNodes[1]-&gt;type != OP_COMMA) {
+              $n-&gt;treeNodes[1] = new JSNode($this-&gt;t, JS_LIST, $n-&gt;treeNodes[1]);
+            }
+            else {
+              $n-&gt;treeNodes[1]-&gt;type = JS_LIST;
+            }
+          }
+
+          --$x-&gt;parenLevel;
+          break;
+
+          // Automatic semicolon insertion means we may scan across a newline
+          // and into the beginning of another statement.  If so, break out of
+          // the while loop and let the t.scanOperand logic handle errors.
+        default:
+          break 2;
+      }
+    }
+
+    if ($x-&gt;hookLevel != $hl) {
+      throw $this-&gt;t-&gt;newSyntaxError(&#039;Missing : in conditional expression&#039;);
+    }
+
+    if ($x-&gt;parenLevel != $pl) {
+      throw $this-&gt;t-&gt;newSyntaxError(&#039;Missing ) in parenthetical&#039;);
+    }
+
+    if ($x-&gt;bracketLevel != $bl) {
+      throw $this-&gt;t-&gt;newSyntaxError(&#039;Missing ] in index expression&#039;);
+    }
+
+    if ($this-&gt;t-&gt;scanOperand) {
+      throw $this-&gt;t-&gt;newSyntaxError(&#039;Missing operand&#039;);
+    }
+
+    // Resume default mode, scanning for operands, not operators.
+    $this-&gt;t-&gt;scanOperand = true;
+    $this-&gt;t-&gt;unget();
+
+    while (count($operators)) {
+      $this-&gt;reduce($operators, $operands);
+    }
+
+    return array_pop($operands);
+  }
+
+  private function ParenExpression($x) {
+    $this-&gt;t-&gt;mustMatch(OP_LEFT_PAREN);
+    $n = $this-&gt;Expression($x);
+    $this-&gt;t-&gt;mustMatch(OP_RIGHT_PAREN);
+
+    return $n;
+  }
+
+  // Statement stack and nested statement handler.
+  private function nest($x, $node, $end = false) {
+    array_push($x-&gt;stmtStack, $node);
+    $n = $this-&gt;statement($x);
+    array_pop($x-&gt;stmtStack);
+
+    if ($end) {
+      $this-&gt;t-&gt;mustMatch($end);
+    }
+
+    return $n;
+  }
+
+  private function reduce(&amp;$operators, &amp;$operands) {
+    $n = array_pop($operators);
+    $op = $n-&gt;type;
+    $arity = $this-&gt;opArity[$op];
+    $c = count($operands);
+    if ($arity == -2) {
+      // Flatten left-associative trees
+      if ($c &gt;= 2) {
+        $left = $operands[$c - 2];
+        if ($left-&gt;type == $op) {
+          $right = array_pop($operands);
+          $left-&gt;addNode($right);
+          return $left;
+        }
+      }
+      $arity = 2;
+    }
+
+    // Always use push to add operands to n, to update start and end
+    $a = array_splice($operands, $c - $arity);
+    for ($i = 0; $i &lt; $arity; $i++) {
+      $n-&gt;addNode($a[$i]);
+    }
+
+    // Include closing bracket or postfix operator in [start,end]
+    $te = $this-&gt;t-&gt;currentToken()-&gt;end;
+    if ($n-&gt;end &lt; $te) {
+      $n-&gt;end = $te;
+    }
 
-		array_push($operands, $n);
+    array_push($operands, $n);
 
-		return $n;
-	}
+    return $n;
+  }
 }
 
-class JSCompilerContext
-{
-	public $inFunction = false;
-	public $inForLoopInit = false;
-	public $ecmaStrictMode = false;
-	public $bracketLevel = 0;
-	public $curlyLevel = 0;
-	public $parenLevel = 0;
-	public $hookLevel = 0;
-
-	public $stmtStack = array();
-	public $funDecls = array();
-	public $varDecls = array();
-
-	public function __construct($inFunction)
-	{
-		$this-&gt;inFunction = $inFunction;
-	}
+class JSCompilerContext {
+  public $inFunction = false;
+  public $inForLoopInit = false;
+  public $ecmaStrictMode = false;
+  public $bracketLevel = 0;
+  public $curlyLevel = 0;
+  public $parenLevel = 0;
+  public $hookLevel = 0;
+
+  public $stmtStack = array();
+  public $funDecls = array();
+  public $varDecls = array();
+
+  public function __construct($inFunction) {
+    $this-&gt;inFunction = $inFunction;
+  }
 }
 
-class JSNode
-{
-	private $type;
-	private $value;
-	private $lineno;
-	private $start;
-	private $end;
-
-	public $treeNodes = array();
-	public $funDecls = array();
-	public $varDecls = array();
-
-	public function __construct($t, $type=0)
-	{
-		if ($token = $t-&gt;currentToken())
-		{
-			$this-&gt;type = $type ? $type : $token-&gt;type;
-			$this-&gt;value = $token-&gt;value;
-			$this-&gt;lineno = $token-&gt;lineno;
-			$this-&gt;start = $token-&gt;start;
-			$this-&gt;end = $token-&gt;end;
-		}
-		else
-		{
-			$this-&gt;type = $type;
-			$this-&gt;lineno = $t-&gt;lineno;
-		}
-
-		if (($numargs = func_num_args()) &gt; 2)
-		{
-			$args = func_get_args();
-			for ($i = 2; $i &lt; $numargs; $i++)
-				$this-&gt;addNode($args[$i]);
-		}
-	}
-
-	// we don&#039;t want to bloat our object with all kind of specific properties, so we use overloading
-	public function __set($name, $value)
-	{
-		$this-&gt;$name = $value;
-	}
-
-	public function __get($name)
-	{
-		if (isset($this-&gt;$name))
-			return $this-&gt;$name;
-
-		return null;
-	}
-
-	public function addNode($node)
-	{
-		if ($node !== null)
-		{
-			if ($node-&gt;start &lt; $this-&gt;start)
-				$this-&gt;start = $node-&gt;start;
-			if ($this-&gt;end &lt; $node-&gt;end)
-				$this-&gt;end = $node-&gt;end;
-		}
+class JSNode {
+  private $type;
+  private $value;
+  private $lineno;
+  private $start;
+  private $end;
+
+  public $treeNodes = array();
+  public $funDecls = array();
+  public $varDecls = array();
+
+  public function __construct($t, $type = 0) {
+    if ($token = $t-&gt;currentToken()) {
+      $this-&gt;type = $type ? $type : $token-&gt;type;
+      $this-&gt;value = $token-&gt;value;
+      $this-&gt;lineno = $token-&gt;lineno;
+      $this-&gt;start = $token-&gt;start;
+      $this-&gt;end = $token-&gt;end;
+    }
+    else {
+      $this-&gt;type = $type;
+      $this-&gt;lineno = $t-&gt;lineno;
+    }
+
+    if (($numargs = func_num_args()) &gt; 2) {
+      $args = func_get_args();
+      for ($i = 2; $i &lt; $numargs; $i++) {
+        $this-&gt;addNode($args[$i]);
+      }
+    }
+  }
+
+  // we don&#039;t want to bloat our object with all kind of specific properties, so we use overloading
+  public function __set($name, $value) {
+    $this-&gt;$name = $value;
+  }
+
+  public function __get($name) {
+    if (isset($this-&gt;$name)) {
+      return $this-&gt;$name;
+    }
+
+    return null;
+  }
+
+  public function addNode($node) {
+    if ($node !== null) {
+      if ($node-&gt;start &lt; $this-&gt;start) {
+        $this-&gt;start = $node-&gt;start;
+      }
+      if ($this-&gt;end &lt; $node-&gt;end) {
+        $this-&gt;end = $node-&gt;end;
+      }
+    }
 
-		$this-&gt;treeNodes[] = $node;
-	}
+    $this-&gt;treeNodes[] = $node;
+  }
 }
 
-class JSTokenizer
-{
-	private $cursor = 0;
-	private $source;
-
-	public $tokens = array();
-	public $tokenIndex = 0;
-	public $lookahead = 0;
-	public $scanNewlines = false;
-	public $scanOperand = true;
-
-	public $filename;
-	public $lineno;
-
-	private $keywords = array(
-		&#039;break&#039;,
-		&#039;case&#039;, &#039;catch&#039;, &#039;const&#039;, &#039;continue&#039;,
-		&#039;debugger&#039;, &#039;default&#039;, &#039;delete&#039;, &#039;do&#039;,
-		&#039;else&#039;, &#039;enum&#039;,
-		&#039;false&#039;, &#039;finally&#039;, &#039;for&#039;, &#039;function&#039;,
-		&#039;if&#039;, &#039;in&#039;, &#039;instanceof&#039;,
-		&#039;new&#039;, &#039;null&#039;,
-		&#039;return&#039;,
-		&#039;switch&#039;,
-		&#039;this&#039;, &#039;throw&#039;, &#039;true&#039;, &#039;try&#039;, &#039;typeof&#039;,
-		&#039;var&#039;, &#039;void&#039;,
-		&#039;while&#039;, &#039;with&#039;
-	);
-
-	private $opTypeNames = array(
-		&#039;;&#039;, &#039;,&#039;, &#039;?&#039;, &#039;:&#039;, &#039;||&#039;, &#039;&amp;&amp;&#039;, &#039;|&#039;, &#039;^&#039;,
-		&#039;&amp;&#039;, &#039;===&#039;, &#039;==&#039;, &#039;=&#039;, &#039;!==&#039;, &#039;!=&#039;, &#039;&lt;&lt;&#039;, &#039;&lt;=&#039;,
-		&#039;&lt;&#039;, &#039;&gt;&gt;&gt;&#039;, &#039;&gt;&gt;&#039;, &#039;&gt;=&#039;, &#039;&gt;&#039;, &#039;++&#039;, &#039;--&#039;, &#039;+&#039;,
-		&#039;-&#039;, &#039;*&#039;, &#039;/&#039;, &#039;%&#039;, &#039;!&#039;, &#039;~&#039;, &#039;.&#039;, &#039;[&#039;,
-		&#039;]&#039;, &#039;{&#039;, &#039;}&#039;, &#039;(&#039;, &#039;)&#039;, &#039;@*/&#039;
-	);
-
-	private $assignOps = array(&#039;|&#039;, &#039;^&#039;, &#039;&amp;&#039;, &#039;&lt;&lt;&#039;, &#039;&gt;&gt;&#039;, &#039;&gt;&gt;&gt;&#039;, &#039;+&#039;, &#039;-&#039;, &#039;*&#039;, &#039;/&#039;, &#039;%&#039;);
-	private $opRegExp;
-
-	public function __construct()
-	{
-		$this-&gt;opRegExp = &#039;#^(&#039; . implode(&#039;|&#039;, array_map(&#039;preg_quote&#039;, $this-&gt;opTypeNames)) . &#039;)#&#039;;
-	}
-
-	public function init($source, $filename = &#039;&#039;, $lineno = 1)
-	{
-		$this-&gt;source = $source;
-		$this-&gt;filename = $filename ? $filename : &#039;[inline]&#039;;
-		$this-&gt;lineno = $lineno;
-
-		$this-&gt;cursor = 0;
-		$this-&gt;tokens = array();
-		$this-&gt;tokenIndex = 0;
-		$this-&gt;lookahead = 0;
-		$this-&gt;scanNewlines = false;
-		$this-&gt;scanOperand = true;
-	}
-
-	public function getInput($chunksize)
-	{
-		if ($chunksize)
-			return substr($this-&gt;source, $this-&gt;cursor, $chunksize);
-
-		return substr($this-&gt;source, $this-&gt;cursor);
-	}
-
-	public function isDone()
-	{
-		return $this-&gt;peek() == TOKEN_END;
-	}
-
-	public function match($tt)
-	{
-		return $this-&gt;get() == $tt || $this-&gt;unget();
-	}
-
-	public function mustMatch($tt)
-	{
-	        if (!$this-&gt;match($tt))
-			throw $this-&gt;newSyntaxError(&#039;Unexpected token; token &#039; . $tt . &#039; expected&#039;);
-
-		return $this-&gt;currentToken();
-	}
-
-	public function peek()
-	{
-		if ($this-&gt;lookahead)
-		{
-			$next = $this-&gt;tokens[($this-&gt;tokenIndex + $this-&gt;lookahead) &amp; 3];
-			if ($this-&gt;scanNewlines &amp;&amp; $next-&gt;lineno != $this-&gt;lineno)
-				$tt = TOKEN_NEWLINE;
-			else
-				$tt = $next-&gt;type;
-		}
-		else
-		{
-			$tt = $this-&gt;get();
-			$this-&gt;unget();
-		}
-
-		return $tt;
-	}
-
-	public function peekOnSameLine()
-	{
-		$this-&gt;scanNewlines = true;
-		$tt = $this-&gt;peek();
-		$this-&gt;scanNewlines = false;
-
-		return $tt;
-	}
-
-	public function currentToken()
-	{
-		if (!empty($this-&gt;tokens))
-			return $this-&gt;tokens[$this-&gt;tokenIndex];
-	}
-
-	public function get($chunksize = 1000)
-	{
-		while($this-&gt;lookahead)
-		{
-			$this-&gt;lookahead--;
-			$this-&gt;tokenIndex = ($this-&gt;tokenIndex + 1) &amp; 3;
-			$token = $this-&gt;tokens[$this-&gt;tokenIndex];
-			if ($token-&gt;type != TOKEN_NEWLINE || $this-&gt;scanNewlines)
-				return $token-&gt;type;
-		}
-
-		$conditional_comment = false;
-
-		// strip whitespace and comments
-		while(true)
-		{
-			$input = $this-&gt;getInput($chunksize);
-
-			// whitespace handling; gobble up \r as well (effectively we don&#039;t have support for MAC newlines!)
-			$re = $this-&gt;scanNewlines ? &#039;/^[ \r\t]+/&#039; : &#039;/^\s+/&#039;;
-			if (preg_match($re, $input, $match))
-			{
-				$spaces = $match[0];
-				$spacelen = strlen($spaces);
-				$this-&gt;cursor += $spacelen;
-				if (!$this-&gt;scanNewlines)
-					$this-&gt;lineno += substr_count($spaces, &quot;\n&quot;);
-
-				if ($spacelen == $chunksize)
-					continue; // complete chunk contained whitespace
-
-				$input = $this-&gt;getInput($chunksize);
-				if ($input == &#039;&#039; || $input[0] != &#039;/&#039;)
-					break;
-			}
-
-			// Comments
-			if (!preg_match(&#039;/^\/(?:\*(@(?:cc_on|if|elif|else|end))?.*?\*\/|\/[^\n]*)/s&#039;, $input, $match))
-			{
-				if (!$chunksize)
-					break;
-
-				// retry with a full chunk fetch; this also prevents breakage of long regular expressions (which will never match a comment)
-				$chunksize = null;
-				continue;
-			}
-
-			// check if this is a conditional (JScript) comment
-			if (!empty($match[1]))
-			{
-				$match[0] = &#039;/*&#039; . $match[1];
-				$conditional_comment = true;
-				break;
-			}
-			else
-			{
-				$this-&gt;cursor += strlen($match[0]);
-				$this-&gt;lineno += substr_count($match[0], &quot;\n&quot;);
-			}
-		}
-
-		if ($input == &#039;&#039;)
-		{
-			$tt = TOKEN_END;
-			$match = array(&#039;&#039;);
-		}
-		elseif ($conditional_comment)
-		{
-			$tt = TOKEN_CONDCOMMENT_START;
-		}
-		else
-		{
-			switch ($input[0])
-			{
-				case &#039;0&#039;:
-					// hexadecimal
-					if (($input[1] == &#039;x&#039; || $input[1] == &#039;X&#039;) &amp;&amp; preg_match(&#039;/^0x[0-9a-f]+/i&#039;, $input, $match))
-					{
-						$tt = TOKEN_NUMBER;
-						break;
-					}
-				// FALL THROUGH
-
-				case &#039;1&#039;: case &#039;2&#039;: case &#039;3&#039;: case &#039;4&#039;: case &#039;5&#039;:
-				case &#039;6&#039;: case &#039;7&#039;: case &#039;8&#039;: case &#039;9&#039;:
-					// should always match
-					preg_match(&#039;/^\d+(?:\.\d*)?(?:[eE][-+]?\d+)?/&#039;, $input, $match);
-					$tt = TOKEN_NUMBER;
-				break;
-
-				case &quot;&#039;&quot;:
-					if (preg_match(&#039;/^\&#039;(?:[^\\\\\&#039;\r\n]++|\\\\(?:.|\r?\n))*\&#039;/&#039;, $input, $match))
-					{
-						$tt = TOKEN_STRING;
-					}
-					else
-					{
-						if ($chunksize)
-							return $this-&gt;get(null); // retry with a full chunk fetch
-
-						throw $this-&gt;newSyntaxError(&#039;Unterminated string literal&#039;);
-					}
-				break;
-
-				case &#039;&quot;&#039;:
-					if (preg_match(&#039;/^&quot;(?:[^\\\\&quot;\r\n]++|\\\\(?:.|\r?\n))*&quot;/&#039;, $input, $match))
-					{
-						$tt = TOKEN_STRING;
-					}
-					else
-					{
-						if ($chunksize)
-							return $this-&gt;get(null); // retry with a full chunk fetch
-
-						throw $this-&gt;newSyntaxError(&#039;Unterminated string literal&#039;);
-					}
-				break;
-
-				case &#039;/&#039;:
-					if ($this-&gt;scanOperand &amp;&amp; preg_match(&#039;/^\/((?:\\\\.|\[(?:\\\\.|[^\]])*\]|[^\/])+)\/([gimy]*)/&#039;, $input, $match))
-					{
-						$tt = TOKEN_REGEXP;
-						break;
-					}
-				// FALL THROUGH
-
-				case &#039;|&#039;:
-				case &#039;^&#039;:
-				case &#039;&amp;&#039;:
-				case &#039;&lt;&#039;:
-				case &#039;&gt;&#039;:
-				case &#039;+&#039;:
-				case &#039;-&#039;:
-				case &#039;*&#039;:
-				case &#039;%&#039;:
-				case &#039;=&#039;:
-				case &#039;!&#039;:
-					// should always match
-					preg_match($this-&gt;opRegExp, $input, $match);
-					$op = $match[0];
-					if (in_array($op, $this-&gt;assignOps) &amp;&amp; $input[strlen($op)] == &#039;=&#039;)
-					{
-						$tt = OP_ASSIGN;
-						$match[0] .= &#039;=&#039;;
-					}
-					else
-					{
-						$tt = $op;
-						if ($this-&gt;scanOperand)
-						{
-							if ($op == OP_PLUS)
-								$tt = OP_UNARY_PLUS;
-							elseif ($op == OP_MINUS)
-								$tt = OP_UNARY_MINUS;
-						}
-						$op = null;
-					}
-				break;
-
-				case &#039;.&#039;:
-					if (preg_match(&#039;/^\.\d+(?:[eE][-+]?\d+)?/&#039;, $input, $match))
-					{
-						$tt = TOKEN_NUMBER;
-						break;
-					}
-				// FALL THROUGH
-
-				case &#039;;&#039;:
-				case &#039;,&#039;:
-				case &#039;?&#039;:
-				case &#039;:&#039;:
-				case &#039;~&#039;:
-				case &#039;[&#039;:
-				case &#039;]&#039;:
-				case &#039;{&#039;:
-				case &#039;}&#039;:
-				case &#039;(&#039;:
-				case &#039;)&#039;:
-					// these are all single
-					$match = array($input[0]);
-					$tt = $input[0];
-				break;
-
-				case &#039;@&#039;:
-					// check end of conditional comment
-					if (substr($input, 0, 3) == &#039;@*/&#039;)
-					{
-						$match = array(&#039;@*/&#039;);
-						$tt = TOKEN_CONDCOMMENT_END;
-					}
-					else
-						throw $this-&gt;newSyntaxError(&#039;Illegal token&#039;);
-				break;
-
-				case &quot;\n&quot;:
-					if ($this-&gt;scanNewlines)
-					{
-						$match = array(&quot;\n&quot;);
-						$tt = TOKEN_NEWLINE;
-					}
-					else
-						throw $this-&gt;newSyntaxError(&#039;Illegal token&#039;);
-				break;
-
-				default:
-					// FIXME: add support for unicode and unicode escape sequence \uHHHH
-					if (preg_match(&#039;/^[$\w]+/&#039;, $input, $match))
-					{
-						$tt = in_array($match[0], $this-&gt;keywords) ? $match[0] : TOKEN_IDENTIFIER;
-					}
-					else
-						throw $this-&gt;newSyntaxError(&#039;Illegal token&#039;);
-			}
-		}
-
-		$this-&gt;tokenIndex = ($this-&gt;tokenIndex + 1) &amp; 3;
-
-		if (!isset($this-&gt;tokens[$this-&gt;tokenIndex]))
-			$this-&gt;tokens[$this-&gt;tokenIndex] = new JSToken();
-
-		$token = $this-&gt;tokens[$this-&gt;tokenIndex];
-		$token-&gt;type = $tt;
-
-		if ($tt == OP_ASSIGN)
-			$token-&gt;assignOp = $op;
-
-		$token-&gt;start = $this-&gt;cursor;
-
-		$token-&gt;value = $match[0];
-		$this-&gt;cursor += strlen($match[0]);
-
-		$token-&gt;end = $this-&gt;cursor;
-		$token-&gt;lineno = $this-&gt;lineno;
-
-		return $tt;
-	}
-
-	public function unget()
-	{
-		if (++$this-&gt;lookahead == 4)
-			throw $this-&gt;newSyntaxError(&#039;PANIC: too much lookahead!&#039;);
-
-		$this-&gt;tokenIndex = ($this-&gt;tokenIndex - 1) &amp; 3;
-	}
-
-	public function newSyntaxError($m)
-	{
-		return new Exception(&#039;Parse error: &#039; . $m . &#039; in file \&#039;&#039; . $this-&gt;filename . &#039;\&#039; on line &#039; . $this-&gt;lineno);
-	}
+class JSTokenizer {
+  private $cursor = 0;
+  private $source;
+
+  public $tokens = array();
+  public $tokenIndex = 0;
+  public $lookahead = 0;
+  public $scanNewlines = false;
+  public $scanOperand = true;
+
+  public $filename;
+  public $lineno;
+
+  private $keywords = array(
+    &#039;break&#039;,
+    &#039;case&#039;,
+    &#039;catch&#039;,
+    &#039;const&#039;,
+    &#039;continue&#039;,
+    &#039;debugger&#039;,
+    &#039;default&#039;,
+    &#039;delete&#039;,
+    &#039;do&#039;,
+    &#039;else&#039;,
+    &#039;enum&#039;,
+    &#039;false&#039;,
+    &#039;finally&#039;,
+    &#039;for&#039;,
+    &#039;function&#039;,
+    &#039;if&#039;,
+    &#039;in&#039;,
+    &#039;instanceof&#039;,
+    &#039;new&#039;,
+    &#039;null&#039;,
+    &#039;return&#039;,
+    &#039;switch&#039;,
+    &#039;this&#039;,
+    &#039;throw&#039;,
+    &#039;true&#039;,
+    &#039;try&#039;,
+    &#039;typeof&#039;,
+    &#039;var&#039;,
+    &#039;void&#039;,
+    &#039;while&#039;,
+    &#039;with&#039;,
+  );
+
+  private $opTypeNames = array(
+    &#039;;&#039;,
+    &#039;,&#039;,
+    &#039;?&#039;,
+    &#039;:&#039;,
+    &#039;||&#039;,
+    &#039;&amp;&amp;&#039;,
+    &#039;|&#039;,
+    &#039;^&#039;,
+    &#039;&amp;&#039;,
+    &#039;===&#039;,
+    &#039;==&#039;,
+    &#039;=&#039;,
+    &#039;!==&#039;,
+    &#039;!=&#039;,
+    &#039;&lt;&lt;&#039;,
+    &#039;&lt;=&#039;,
+    &#039;&lt;&#039;,
+    &#039;&gt;&gt;&gt;&#039;,
+    &#039;&gt;&gt;&#039;,
+    &#039;&gt;=&#039;,
+    &#039;&gt;&#039;,
+    &#039;++&#039;,
+    &#039;--&#039;,
+    &#039;+&#039;,
+    &#039;-&#039;,
+    &#039;*&#039;,
+    &#039;/&#039;,
+    &#039;%&#039;,
+    &#039;!&#039;,
+    &#039;~&#039;,
+    &#039;.&#039;,
+    &#039;[&#039;,
+    &#039;]&#039;,
+    &#039;{&#039;,
+    &#039;}&#039;,
+    &#039;(&#039;,
+    &#039;)&#039;,
+    &#039;@*/&#039;,
+  );
+
+  private $assignOps = array(&#039;|&#039;, &#039;^&#039;, &#039;&amp;&#039;, &#039;&lt;&lt;&#039;, &#039;&gt;&gt;&#039;, &#039;&gt;&gt;&gt;&#039;, &#039;+&#039;, &#039;-&#039;, &#039;*&#039;, &#039;/&#039;, &#039;%&#039;);
+  private $opRegExp;
+
+  public function __construct() {
+    $this-&gt;opRegExp = &#039;#^(&#039; . implode(&#039;|&#039;, array_map(&#039;preg_quote&#039;, $this-&gt;opTypeNames)) . &#039;)#&#039;;
+  }
+
+  public function init($source, $filename = &#039;&#039;, $lineno = 1) {
+    $this-&gt;source = $source;
+    $this-&gt;filename = $filename ? $filename : &#039;[inline]&#039;;
+    $this-&gt;lineno = $lineno;
+
+    $this-&gt;cursor = 0;
+    $this-&gt;tokens = array();
+    $this-&gt;tokenIndex = 0;
+    $this-&gt;lookahead = 0;
+    $this-&gt;scanNewlines = false;
+    $this-&gt;scanOperand = true;
+  }
+
+  public function getInput($chunksize) {
+    if ($chunksize) {
+      return substr($this-&gt;source, $this-&gt;cursor, $chunksize);
+    }
+
+    return substr($this-&gt;source, $this-&gt;cursor);
+  }
+
+  public function isDone() {
+    return $this-&gt;peek() == TOKEN_END;
+  }
+
+  public function match($tt) {
+    return $this-&gt;get() == $tt || $this-&gt;unget();
+  }
+
+  public function mustMatch($tt) {
+    if (!$this-&gt;match($tt)) {
+      throw $this-&gt;newSyntaxError(&#039;Unexpected token; token &#039; . $tt . &#039; expected&#039;);
+    }
+
+    return $this-&gt;currentToken();
+  }
+
+  public function peek() {
+    if ($this-&gt;lookahead) {
+      $next = $this-&gt;tokens[($this-&gt;tokenIndex + $this-&gt;lookahead) &amp; 3];
+      if ($this-&gt;scanNewlines &amp;&amp; $next-&gt;lineno != $this-&gt;lineno) {
+        $tt = TOKEN_NEWLINE;
+      }
+      else {
+        $tt = $next-&gt;type;
+      }
+    }
+    else {
+      $tt = $this-&gt;get();
+      $this-&gt;unget();
+    }
+
+    return $tt;
+  }
+
+  public function peekOnSameLine() {
+    $this-&gt;scanNewlines = true;
+    $tt = $this-&gt;peek();
+    $this-&gt;scanNewlines = false;
+
+    return $tt;
+  }
+
+  public function currentToken() {
+    if (!empty($this-&gt;tokens)) {
+      return $this-&gt;tokens[$this-&gt;tokenIndex];
+    }
+  }
+
+  public function get($chunksize = 1000) {
+    while ($this-&gt;lookahead) {
+      $this-&gt;lookahead--;
+      $this-&gt;tokenIndex = ($this-&gt;tokenIndex + 1) &amp; 3;
+      $token = $this-&gt;tokens[$this-&gt;tokenIndex];
+      if ($token-&gt;type != TOKEN_NEWLINE || $this-&gt;scanNewlines) {
+        return $token-&gt;type;
+      }
+    }
+
+    $conditional_comment = false;
+
+    // strip whitespace and comments
+    while (true) {
+      $input = $this-&gt;getInput($chunksize);
+
+      // whitespace handling; gobble up \r as well (effectively we don&#039;t have support for MAC newlines!)
+      $re = $this-&gt;scanNewlines ? &#039;/^[ \r\t]+/&#039; : &#039;/^\s+/&#039;;
+      if (preg_match($re, $input, $match)) {
+        $spaces = $match[0];
+        $spacelen = strlen($spaces);
+        $this-&gt;cursor += $spacelen;
+        if (!$this-&gt;scanNewlines) {
+          $this-&gt;lineno += substr_count($spaces, &quot;\n&quot;);
+        }
+
+        if ($spacelen == $chunksize) {
+          continue; // complete chunk contained whitespace
+        }
+
+        $input = $this-&gt;getInput($chunksize);
+        if ($input == &#039;&#039; || $input[0] != &#039;/&#039;) {
+          break;
+        }
+      }
+
+      // Comments
+      if (!preg_match(&#039;/^\/(?:\*(@(?:cc_on|if|elif|else|end))?.*?\*\/|\/[^\n]*)/s&#039;, $input, $match)) {
+        if (!$chunksize) {
+          break;
+        }
+
+        // retry with a full chunk fetch; this also prevents breakage of long regular expressions (which will never match a comment)
+        $chunksize = null;
+        continue;
+      }
+
+      // check if this is a conditional (JScript) comment
+      if (!empty($match[1])) {
+        $match[0] = &#039;/*&#039; . $match[1];
+        $conditional_comment = true;
+        break;
+      }
+      else {
+        $this-&gt;cursor += strlen($match[0]);
+        $this-&gt;lineno += substr_count($match[0], &quot;\n&quot;);
+      }
+    }
+
+    if ($input == &#039;&#039;) {
+      $tt = TOKEN_END;
+      $match = array(&#039;&#039;);
+    }
+    elseif ($conditional_comment) {
+      $tt = TOKEN_CONDCOMMENT_START;
+    }
+    else {
+      switch ($input[0]) {
+        case &#039;0&#039;:
+          // hexadecimal
+          if (($input[1] == &#039;x&#039; || $input[1] == &#039;X&#039;) &amp;&amp; preg_match(&#039;/^0x[0-9a-f]+/i&#039;, $input, $match)) {
+            $tt = TOKEN_NUMBER;
+            break;
+          }
+          // FALL THROUGH
+
+        case &#039;1&#039;:
+        case &#039;2&#039;:
+        case &#039;3&#039;:
+        case &#039;4&#039;:
+        case &#039;5&#039;:
+        case &#039;6&#039;:
+        case &#039;7&#039;:
+        case &#039;8&#039;:
+        case &#039;9&#039;:
+          // should always match
+          preg_match(&#039;/^\d+(?:\.\d*)?(?:[eE][-+]?\d+)?/&#039;, $input, $match);
+          $tt = TOKEN_NUMBER;
+          break;
+
+        case &quot;&#039;&quot;:
+          if (preg_match(&#039;/^\&#039;(?:[^\\\\\&#039;\r\n]++|\\\\(?:.|\r?\n))*\&#039;/&#039;, $input, $match)) {
+            $tt = TOKEN_STRING;
+          }
+          else {
+            if ($chunksize) {
+              return $this-&gt;get(null); // retry with a full chunk fetch
+            }
+
+            throw $this-&gt;newSyntaxError(&#039;Unterminated string literal&#039;);
+          }
+          break;
+
+        case &#039;&quot;&#039;:
+          if (preg_match(&#039;/^&quot;(?:[^\\\\&quot;\r\n]++|\\\\(?:.|\r?\n))*&quot;/&#039;, $input, $match)) {
+            $tt = TOKEN_STRING;
+          }
+          else {
+            if ($chunksize) {
+              return $this-&gt;get(null); // retry with a full chunk fetch
+            }
+
+            throw $this-&gt;newSyntaxError(&#039;Unterminated string literal&#039;);
+          }
+          break;
+
+        case &#039;/&#039;:
+          if ($this-&gt;scanOperand &amp;&amp; preg_match(&#039;/^\/((?:\\\\.|\[(?:\\\\.|[^\]])*\]|[^\/])+)\/([gimy]*)/&#039;, $input, $match)) {
+            $tt = TOKEN_REGEXP;
+            break;
+          }
+          // FALL THROUGH
+
+        case &#039;|&#039;:
+        case &#039;^&#039;:
+        case &#039;&amp;&#039;:
+        case &#039;&lt;&#039;:
+        case &#039;&gt;&#039;:
+        case &#039;+&#039;:
+        case &#039;-&#039;:
+        case &#039;*&#039;:
+        case &#039;%&#039;:
+        case &#039;=&#039;:
+        case &#039;!&#039;:
+          // should always match
+          preg_match($this-&gt;opRegExp, $input, $match);
+          $op = $match[0];
+          if (in_array($op, $this-&gt;assignOps) &amp;&amp; $input[strlen($op)] == &#039;=&#039;) {
+            $tt = OP_ASSIGN;
+            $match[0] .= &#039;=&#039;;
+          }
+          else {
+            $tt = $op;
+            if ($this-&gt;scanOperand) {
+              if ($op == OP_PLUS) {
+                $tt = OP_UNARY_PLUS;
+              }
+              elseif ($op == OP_MINUS) {
+                $tt = OP_UNARY_MINUS;
+              }
+            }
+            $op = null;
+          }
+          break;
+
+        case &#039;.&#039;:
+          if (preg_match(&#039;/^\.\d+(?:[eE][-+]?\d+)?/&#039;, $input, $match)) {
+            $tt = TOKEN_NUMBER;
+            break;
+          }
+          // FALL THROUGH
+
+        case &#039;;&#039;:
+        case &#039;,&#039;:
+        case &#039;?&#039;:
+        case &#039;:&#039;:
+        case &#039;~&#039;:
+        case &#039;[&#039;:
+        case &#039;]&#039;:
+        case &#039;{&#039;:
+        case &#039;}&#039;:
+        case &#039;(&#039;:
+        case &#039;)&#039;:
+          // these are all single
+          $match = array($input[0]);
+          $tt = $input[0];
+          break;
+
+        case &#039;@&#039;:
+          // check end of conditional comment
+          if (substr($input, 0, 3) == &#039;@*/&#039;) {
+            $match = array(&#039;@*/&#039;);
+            $tt = TOKEN_CONDCOMMENT_END;
+          }
+          else {
+            throw $this-&gt;newSyntaxError(&#039;Illegal token&#039;);
+          }
+          break;
+
+        case &quot;\n&quot;:
+          if ($this-&gt;scanNewlines) {
+            $match = array(&quot;\n&quot;);
+            $tt = TOKEN_NEWLINE;
+          }
+          else {
+            throw $this-&gt;newSyntaxError(&#039;Illegal token&#039;);
+          }
+          break;
+
+        default:
+          // FIXME: add support for unicode and unicode escape sequence \uHHHH
+          if (preg_match(&#039;/^[$\w]+/&#039;, $input, $match)) {
+            $tt = in_array($match[0], $this-&gt;keywords) ? $match[0] : TOKEN_IDENTIFIER;
+          }
+          else {
+            throw $this-&gt;newSyntaxError(&#039;Illegal token&#039;);
+          }
+      }
+    }
+
+    $this-&gt;tokenIndex = ($this-&gt;tokenIndex + 1) &amp; 3;
+
+    if (!isset($this-&gt;tokens[$this-&gt;tokenIndex])) {
+      $this-&gt;tokens[$this-&gt;tokenIndex] = new JSToken();
+    }
+
+    $token = $this-&gt;tokens[$this-&gt;tokenIndex];
+    $token-&gt;type = $tt;
+
+    if ($tt == OP_ASSIGN) {
+      $token-&gt;assignOp = $op;
+    }
+
+    $token-&gt;start = $this-&gt;cursor;
+
+    $token-&gt;value = $match[0];
+    $this-&gt;cursor += strlen($match[0]);
+
+    $token-&gt;end = $this-&gt;cursor;
+    $token-&gt;lineno = $this-&gt;lineno;
+
+    return $tt;
+  }
+
+  public function unget() {
+    if (++$this-&gt;lookahead == 4) {
+      throw $this-&gt;newSyntaxError(&#039;PANIC: too much lookahead!&#039;);
+    }
+
+    $this-&gt;tokenIndex = ($this-&gt;tokenIndex - 1) &amp; 3;
+  }
+
+  public function newSyntaxError($m) {
+    return new Exception(&#039;Parse error: &#039; . $m . &#039; in file \&#039;&#039; . $this-&gt;filename . &#039;\&#039; on line &#039; . $this-&gt;lineno);
+  }
 }
 
-class JSToken
-{
-	public $type;
-	public $value;
-	public $start;
-	public $end;
-	public $lineno;
-	public $assignOp;
+class JSToken {
+  public $type;
+  public $value;
+  public $start;
+  public $end;
+  public $lineno;
+  public $assignOp;
 }
diff -up -r advagg_js_compress/jspacker.inc advagg_js_compress/jspacker.inc
--- advagg_js_compress/jspacker.inc	2012-03-23 12:08:13.000000000 -0600
+++ advagg_js_compress/jspacker.inc	2012-03-23 13:02:24.000000000 -0600
@@ -67,392 +67,413 @@
 
 
 class JavaScriptPacker {
-	// constants
-	const IGNORE = &#039;$1&#039;;
+  // constants
+  const IGNORE = &#039;$1&#039;;
 
-	// validate parameters
-	private $_script = &#039;&#039;;
-	private $_encoding = 62;
-	private $_fastDecode = true;
-	private $_specialChars = false;
-
-	private $LITERAL_ENCODING = array(
-		&#039;None&#039; =&gt; 0,
-		&#039;Numeric&#039; =&gt; 10,
-		&#039;Normal&#039; =&gt; 62,
-		&#039;High ASCII&#039; =&gt; 95
-	);
-
-	public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = false)
-	{
-		$this-&gt;_script = $_script . &quot;\n&quot;;
-		if (array_key_exists($_encoding, $this-&gt;LITERAL_ENCODING))
-			$_encoding = $this-&gt;LITERAL_ENCODING[$_encoding];
-		$this-&gt;_encoding = min((int)$_encoding, 95);
-		$this-&gt;_fastDecode = $_fastDecode;
-		$this-&gt;_specialChars = $_specialChars;
-	}
-
-	public function pack() {
-		$this-&gt;_addParser(&#039;_basicCompression&#039;);
-		if ($this-&gt;_specialChars)
-			$this-&gt;_addParser(&#039;_encodeSpecialChars&#039;);
-		if ($this-&gt;_encoding)
-			$this-&gt;_addParser(&#039;_encodeKeywords&#039;);
-
-		// go!
-		return $this-&gt;_pack($this-&gt;_script);
-	}
-
-	// apply all parsing routines
-	private function _pack($script) {
-		for ($i = 0; isset($this-&gt;_parsers[$i]); $i++) {
-			$script = call_user_func(array(&amp;$this,$this-&gt;_parsers[$i]), $script);
-		}
-		return $script;
-	}
-
-	// keep a list of parsing functions, they&#039;ll be executed all at once
-	private $_parsers = array();
-	private function _addParser($parser) {
-		$this-&gt;_parsers[] = $parser;
-	}
-
-	// zero encoding - just removal of white space and comments
-	private function _basicCompression($script) {
-		$parser = new ParseMaster();
-		// make safe
-		$parser-&gt;escapeChar = &#039;\\&#039;;
-		// protect strings
-		$parser-&gt;add(&#039;/\&#039;[^\&#039;\\n\\r]*\&#039;/&#039;, self::IGNORE);
-		$parser-&gt;add(&#039;/&quot;[^&quot;\\n\\r]*&quot;/&#039;, self::IGNORE);
-		// remove comments
-		$parser-&gt;add(&#039;/\\/\\/[^\\n\\r]*[\\n\\r]/&#039;, &#039; &#039;);
-		$parser-&gt;add(&#039;/\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\//&#039;, &#039; &#039;);
-		// protect regular expressions
-		$parser-&gt;add(&#039;/\\s+(\\/[^\\/\\n\\r\\*][^\\/\\n\\r]*\\/g?i?)/&#039;, &#039;$2&#039;); // IGNORE
-		$parser-&gt;add(&#039;/[^\\w\\x24\\/\&#039;&quot;*)\\?:]\\/[^\\/\\n\\r\\*][^\\/\\n\\r]*\\/g?i?/&#039;, self::IGNORE);
-		// remove: ;;; doSomething();
-		if ($this-&gt;_specialChars) $parser-&gt;add(&#039;/;;;[^\\n\\r]+[\\n\\r]/&#039;);
-		// remove redundant semi-colons
-		$parser-&gt;add(&#039;/\\(;;\\)/&#039;, self::IGNORE); // protect for (;;) loops
-		$parser-&gt;add(&#039;/;+\\s*([};])/&#039;, &#039;$2&#039;);
-		// apply the above
-		$script = $parser-&gt;exec($script);
-
-		// remove white-space
-		$parser-&gt;add(&#039;/(\\b|\\x24)\\s+(\\b|\\x24)/&#039;, &#039;$2 $3&#039;);
-		$parser-&gt;add(&#039;/([+\\-])\\s+([+\\-])/&#039;, &#039;$2 $3&#039;);
-		$parser-&gt;add(&#039;/\\s+/&#039;, &#039;&#039;);
-		// done
-		return $parser-&gt;exec($script);
-	}
-
-	private function _encodeSpecialChars($script) {
-		$parser = new ParseMaster();
-		// replace: $name -&gt; n, $$name -&gt; na
-		$parser-&gt;add(&#039;/((\\x24+)([a-zA-Z$_]+))(\\d*)/&#039;,
+  // validate parameters
+  private $_script = &#039;&#039;;
+  private $_encoding = 62;
+  private $_fastDecode = true;
+  private $_specialChars = false;
+
+  private $LITERAL_ENCODING = array(
+    &#039;None&#039; =&gt; 0,
+    &#039;Numeric&#039; =&gt; 10,
+    &#039;Normal&#039; =&gt; 62,
+    &#039;High ASCII&#039; =&gt; 95,
+  );
+
+  public function __construct($_script, $_encoding = 62, $_fastDecode = true, $_specialChars = false) {
+    $this-&gt;_script = $_script . &quot;\n&quot;;
+    if (array_key_exists($_encoding, $this-&gt;LITERAL_ENCODING)) {
+      $_encoding = $this-&gt;LITERAL_ENCODING[$_encoding];
+    }
+    $this-&gt;_encoding = min((int) $_encoding, 95);
+    $this-&gt;_fastDecode = $_fastDecode;
+    $this-&gt;_specialChars = $_specialChars;
+  }
+
+  public function pack() {
+    $this-&gt;_addParser(&#039;_basicCompression&#039;);
+    if ($this-&gt;_specialChars) {
+      $this-&gt;_addParser(&#039;_encodeSpecialChars&#039;);
+    }
+    if ($this-&gt;_encoding) {
+      $this-&gt;_addParser(&#039;_encodeKeywords&#039;);
+    }
+
+    // go!
+    return $this-&gt;_pack($this-&gt;_script);
+  }
+
+  // apply all parsing routines
+  private function _pack($script) {
+    for ($i = 0; isset($this-&gt;_parsers[$i]); $i++) {
+      $script = call_user_func(array(&amp;$this, $this-&gt;_parsers[$i]), $script);
+    }
+    return $script;
+  }
+
+  // keep a list of parsing functions, they&#039;ll be executed all at once
+  private $_parsers = array();
+  private function _addParser($parser) {
+    $this-&gt;_parsers[] = $parser;
+  }
+
+  // zero encoding - just removal of white space and comments
+  private function _basicCompression($script) {
+    $parser = new ParseMaster();
+    // make safe
+    $parser-&gt;escapeChar = &#039;\\&#039;;
+    // protect strings
+    $parser-&gt;add(&#039;/\&#039;[^\&#039;\\n\\r]*\&#039;/&#039;, self::IGNORE);
+    $parser-&gt;add(&#039;/&quot;[^&quot;\\n\\r]*&quot;/&#039;, self::IGNORE);
+    // remove comments
+    $parser-&gt;add(&#039;/\\/\\/[^\\n\\r]*[\\n\\r]/&#039;, &#039; &#039;);
+    $parser-&gt;add(&#039;/\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\//&#039;, &#039; &#039;);
+    // protect regular expressions
+    $parser-&gt;add(&#039;/\\s+(\\/[^\\/\\n\\r\\*][^\\/\\n\\r]*\\/g?i?)/&#039;, &#039;$2&#039;); // IGNORE
+    $parser-&gt;add(&#039;/[^\\w\\x24\\/\&#039;&quot;*)\\?:]\\/[^\\/\\n\\r\\*][^\\/\\n\\r]*\\/g?i?/&#039;, self::IGNORE);
+    // remove: ;;; doSomething();
+    if ($this-&gt;_specialChars) {
+      $parser-&gt;add(&#039;/;;;[^\\n\\r]+[\\n\\r]/&#039;);
+    }
+    // remove redundant semi-colons
+    $parser-&gt;add(&#039;/\\(;;\\)/&#039;, self::IGNORE); // protect for (;;) loops
+    $parser-&gt;add(&#039;/;+\\s*([};])/&#039;, &#039;$2&#039;);
+    // apply the above
+    $script = $parser-&gt;exec($script);
+
+    // remove white-space
+    $parser-&gt;add(&#039;/(\\b|\\x24)\\s+(\\b|\\x24)/&#039;, &#039;$2 $3&#039;);
+    $parser-&gt;add(&#039;/([+\\-])\\s+([+\\-])/&#039;, &#039;$2 $3&#039;);
+    $parser-&gt;add(&#039;/\\s+/&#039;, &#039;&#039;);
+    // done
+    return $parser-&gt;exec($script);
+  }
+
+  private function _encodeSpecialChars($script) {
+    $parser = new ParseMaster();
+    // replace: $name -&gt; n, $$name -&gt; na
+    $parser-&gt;add(&#039;/((\\x24+)([a-zA-Z$_]+))(\\d*)/&#039;,
 					 array(&#039;fn&#039; =&gt; &#039;_replace_name&#039;)
 		);
-		// replace: _name -&gt; _0, double-underscore (__name) is ignored
-		$regexp = &#039;/\\b_[A-Za-z\\d]\\w*/&#039;;
-		// build the word list
-		$keywords = $this-&gt;_analyze($script, $regexp, &#039;_encodePrivate&#039;);
-		// quick ref
-		$encoded = $keywords[&#039;encoded&#039;];
+    // replace: _name -&gt; _0, double-underscore (__name) is ignored
+    $regexp = &#039;/\\b_[A-Za-z\\d]\\w*/&#039;;
+    // build the word list
+    $keywords = $this-&gt;_analyze($script, $regexp, &#039;_encodePrivate&#039;);
+    // quick ref
+    $encoded = $keywords[&#039;encoded&#039;];
 
-		$parser-&gt;add($regexp,
+    $parser-&gt;add($regexp,
 			array(
-				&#039;fn&#039; =&gt; &#039;_replace_encoded&#039;,
-				&#039;data&#039; =&gt; $encoded
-			)
+      &#039;fn&#039; =&gt; &#039;_replace_encoded&#039;,
+      &#039;data&#039; =&gt; $encoded,
+    )
 		);
-		return $parser-&gt;exec($script);
-	}
+    return $parser-&gt;exec($script);
+  }
 
-	private function _encodeKeywords($script) {
-		// escape high-ascii values already in the script (i.e. in strings)
-		if ($this-&gt;_encoding &gt; 62)
-			$script = $this-&gt;_escape95($script);
-		// create the parser
-		$parser = new ParseMaster();
-		$encode = $this-&gt;_getEncoder($this-&gt;_encoding);
-		// for high-ascii, don&#039;t encode single character low-ascii
-		$regexp = ($this-&gt;_encoding &gt; 62) ? &#039;/\\w\\w+/&#039; : &#039;/\\w+/&#039;;
-		// build the word list
-		$keywords = $this-&gt;_analyze($script, $regexp, $encode);
-		$encoded = $keywords[&#039;encoded&#039;];
+  private function _encodeKeywords($script) {
+    // escape high-ascii values already in the script (i.e. in strings)
+    if ($this-&gt;_encoding &gt; 62) {
+      $script = $this-&gt;_escape95($script);
+    }
+    // create the parser
+    $parser = new ParseMaster();
+    $encode = $this-&gt;_getEncoder($this-&gt;_encoding);
+    // for high-ascii, don&#039;t encode single character low-ascii
+    $regexp = ($this-&gt;_encoding &gt; 62) ? &#039;/\\w\\w+/&#039; : &#039;/\\w+/&#039;;
+    // build the word list
+    $keywords = $this-&gt;_analyze($script, $regexp, $encode);
+    $encoded = $keywords[&#039;encoded&#039;];
 
-		// encode
-		$parser-&gt;add($regexp,
+    // encode
+    $parser-&gt;add($regexp,
 			array(
-				&#039;fn&#039; =&gt; &#039;_replace_encoded&#039;,
-				&#039;data&#039; =&gt; $encoded
-			)
+      &#039;fn&#039; =&gt; &#039;_replace_encoded&#039;,
+      &#039;data&#039; =&gt; $encoded,
+    )
 		);
-		if (empty($script)) return $script;
-		else {
-			//$res = $parser-&gt;exec($script);
-			//$res = $this-&gt;_bootStrap($res, $keywords);
-			//return $res;
-			return $this-&gt;_bootStrap($parser-&gt;exec($script), $keywords);
-		}
-	}
-
-	private function _analyze($script, $regexp, $encode) {
-		// analyse
-		// retreive all words in the script
-		$all = array();
-		preg_match_all($regexp, $script, $all);
-		$_sorted = array(); // list of words sorted by frequency
-		$_encoded = array(); // dictionary of word-&gt;encoding
-		$_protected = array(); // instances of &quot;protected&quot; words
-		$all = $all[0]; // simulate the javascript comportement of global match
-		if (!empty($all)) {
-			$unsorted = array(); // same list, not sorted
-			$protected = array(); // &quot;protected&quot; words (dictionary of word-&gt;&quot;word&quot;)
-			$value = array(); // dictionary of charCode-&gt;encoding (eg. 256-&gt;ff)
-			$this-&gt;_count = array(); // word-&gt;count
-			$i = count($all); $j = 0; //$word = null;
-			// count the occurrences - used for sorting later
-			do {
-				--$i;
-				$word = &#039;$&#039; . $all[$i];
-				if (!isset($this-&gt;_count[$word])) {
-					$this-&gt;_count[$word] = 0;
-					$unsorted[$j] = $word;
-					// make a dictionary of all of the protected words in this script
-					//  these are words that might be mistaken for encoding
-					//if (is_string($encode) &amp;&amp; method_exists($this, $encode))
-					$values[$j] = call_user_func(array(&amp;$this, $encode), $j);
-					$protected[&#039;$&#039; . $values[$j]] = $j++;
-				}
-				// increment the word counter
-				$this-&gt;_count[$word]++;
-			} while ($i &gt; 0);
-			// prepare to sort the word list, first we must protect
-			//  words that are also used as codes. we assign them a code
-			//  equivalent to the word itself.
-			// e.g. if &quot;do&quot; falls within our encoding range
-			//      then we store keywords[&quot;do&quot;] = &quot;do&quot;;
-			// this avoids problems when decoding
-			$i = count($unsorted);
-			do {
-				$word = $unsorted[--$i];
-				if (isset($protected[$word]) /*!= null*/) {
-					$_sorted[$protected[$word]] = substr($word, 1);
-					$_protected[$protected[$word]] = true;
-					$this-&gt;_count[$word] = 0;
-				}
-			} while ($i);
-
-			// sort the words by frequency
-			// Note: the javascript and php version of sort can be different :
-			// in php manual, usort :
-			// &quot; If two members compare as equal,
-			// their order in the sorted array is undefined.&quot;
-			// so the final packed script is different of the Dean&#039;s javascript version
-			// but equivalent.
-			// the ECMAscript standard does not guarantee this behaviour,
-			// and thus not all browsers (e.g. Mozilla versions dating back to at
-			// least 2003) respect this.
-			usort($unsorted, array(&amp;$this, &#039;_sortWords&#039;));
-			$j = 0;
-			// because there are &quot;protected&quot; words in the list
-			//  we must add the sorted words around them
-			do {
-				if (!isset($_sorted[$i]))
-					$_sorted[$i] = substr($unsorted[$j++], 1);
-				$_encoded[$_sorted[$i]] = $values[$i];
-			} while (++$i &lt; count($unsorted));
-		}
-		return array(
-			&#039;sorted&#039;  =&gt; $_sorted,
-			&#039;encoded&#039; =&gt; $_encoded,
-			&#039;protected&#039; =&gt; $_protected);
-	}
-
-	private $_count = array();
-	private function _sortWords($match1, $match2) {
-		return $this-&gt;_count[$match2] - $this-&gt;_count[$match1];
-	}
-
-	// build the boot function used for loading and decoding
-	private function _bootStrap($packed, $keywords) {
-		$ENCODE = $this-&gt;_safeRegExp(&#039;$encode\\($count\\)&#039;);
-
-		// $packed: the packed script
-		$packed = &quot;&#039;&quot; . $this-&gt;_escape($packed) . &quot;&#039;&quot;;
-
-		// $ascii: base for encoding
-		$ascii = min(count($keywords[&#039;sorted&#039;]), $this-&gt;_encoding);
-		if ($ascii == 0) $ascii = 1;
-
-		// $count: number of words contained in the script
-		$count = count($keywords[&#039;sorted&#039;]);
-
-		// $keywords: list of words contained in the script
-		foreach ($keywords[&#039;protected&#039;] as $i=&gt;$value) {
-			$keywords[&#039;sorted&#039;][$i] = &#039;&#039;;
-		}
-		// convert from a string to an array
-		ksort($keywords[&#039;sorted&#039;]);
-		$keywords = &quot;&#039;&quot; . implode(&#039;|&#039;,$keywords[&#039;sorted&#039;]) . &quot;&#039;.split(&#039;|&#039;)&quot;;
-
-		$encode = ($this-&gt;_encoding &gt; 62) ? &#039;_encode95&#039; : $this-&gt;_getEncoder($ascii);
-		$encode = $this-&gt;_getJSFunction($encode);
-		$encode = preg_replace(&#039;/_encoding/&#039;,&#039;$ascii&#039;, $encode);
-		$encode = preg_replace(&#039;/arguments\\.callee/&#039;,&#039;$encode&#039;, $encode);
-		$inline = &#039;\\$count&#039; . ($ascii &gt; 10 ? &#039;.toString(\\$ascii)&#039; : &#039;&#039;);
-
-		// $decode: code snippet to speed up decoding
-		if ($this-&gt;_fastDecode) {
-			// create the decoder
-			$decode = $this-&gt;_getJSFunction(&#039;_decodeBody&#039;);
-			if ($this-&gt;_encoding &gt; 62)
-				$decode = preg_replace(&#039;/\\\\w/&#039;, &#039;[\\xa1-\\xff]&#039;, $decode);
-			// perform the encoding inline for lower ascii values
-			elseif ($ascii &lt; 36)
-				$decode = preg_replace($ENCODE, $inline, $decode);
-			// special case: when $count==0 there are no keywords. I want to keep
-			//  the basic shape of the unpacking funcion so i&#039;ll frig the code...
-			if ($count == 0)
-				$decode = preg_replace($this-&gt;_safeRegExp(&#039;($count)\\s*=\\s*1&#039;), &#039;$1=0&#039;, $decode, 1);
-		}
-
-		// boot function
-		$unpack = $this-&gt;_getJSFunction(&#039;_unpack&#039;);
-		if ($this-&gt;_fastDecode) {
-			// insert the decoder
-			$this-&gt;buffer = $decode;
-			$unpack = preg_replace_callback(&#039;/\\{/&#039;, array(&amp;$this, &#039;_insertFastDecode&#039;), $unpack, 1);
-		}
-		$unpack = preg_replace(&#039;/&quot;/&#039;, &quot;&#039;&quot;, $unpack);
-		if ($this-&gt;_encoding &gt; 62) { // high-ascii
-			// get rid of the word-boundaries for regexp matches
-			$unpack = preg_replace(&#039;/\&#039;\\\\\\\\b\&#039;\s*\\+|\\+\s*\&#039;\\\\\\\\b\&#039;/&#039;, &#039;&#039;, $unpack);
-		}
-		if ($ascii &gt; 36 || $this-&gt;_encoding &gt; 62 || $this-&gt;_fastDecode) {
-			// insert the encode function
-			$this-&gt;buffer = $encode;
-			$unpack = preg_replace_callback(&#039;/\\{/&#039;, array(&amp;$this, &#039;_insertFastEncode&#039;), $unpack, 1);
-		} else {
-			// perform the encoding inline
-			$unpack = preg_replace($ENCODE, $inline, $unpack);
-		}
-		// pack the boot function too
-		$unpackPacker = new JavaScriptPacker($unpack, 0, false, true);
-		$unpack = $unpackPacker-&gt;pack();
-
-		// arguments
-		$params = array($packed, $ascii, $count, $keywords);
-		if ($this-&gt;_fastDecode) {
-			$params[] = 0;
-			$params[] = &#039;{}&#039;;
-		}
-		$params = implode(&#039;,&#039;, $params);
-
-		// the whole thing
-		return &#039;eval(&#039; . $unpack . &#039;(&#039; . $params . &quot;))\n&quot;;
-	}
-
-	private $buffer;
-	private function _insertFastDecode($match) {
-		return &#039;{&#039; . $this-&gt;buffer . &#039;;&#039;;
-	}
-	private function _insertFastEncode($match) {
-		return &#039;{$encode=&#039; . $this-&gt;buffer . &#039;;&#039;;
-	}
-
-	// mmm.. ..which one do i need ??
-	private function _getEncoder($ascii) {
-		return $ascii &gt; 10 ? $ascii &gt; 36 ? $ascii &gt; 62 ?
+    if (empty($script)) {
+      return $script;
+    }
+    else {
+      //$res = $parser-&gt;exec($script);
+      //$res = $this-&gt;_bootStrap($res, $keywords);
+      //return $res;
+      return $this-&gt;_bootStrap($parser-&gt;exec($script), $keywords);
+    }
+  }
+
+  private function _analyze($script, $regexp, $encode) {
+    // analyse
+    // retreive all words in the script
+    $all = array();
+    preg_match_all($regexp, $script, $all);
+    $_sorted = array(); // list of words sorted by frequency
+    $_encoded = array(); // dictionary of word-&gt;encoding
+    $_protected = array(); // instances of &quot;protected&quot; words
+    $all = $all[0]; // simulate the javascript comportement of global match
+    if (!empty($all)) {
+      $unsorted = array(); // same list, not sorted
+      $protected = array(); // &quot;protected&quot; words (dictionary of word-&gt;&quot;word&quot;)
+      $value = array(); // dictionary of charCode-&gt;encoding (eg. 256-&gt;ff)
+      $this-&gt;_count = array(); // word-&gt;count
+      $i = count($all);
+      $j = 0; //$word = null;
+      // count the occurrences - used for sorting later
+      do {
+        --$i;
+        $word = &#039;$&#039; . $all[$i];
+        if (!isset($this-&gt;_count[$word])) {
+          $this-&gt;_count[$word] = 0;
+          $unsorted[$j] = $word;
+          // make a dictionary of all of the protected words in this script
+//  these are words that might be mistaken for encoding
+          //if (is_string($encode) &amp;&amp; method_exists($this, $encode))
+          $values[$j] = call_user_func(array(&amp;$this, $encode), $j);
+          $protected[&#039;$&#039; . $values[$j]] = $j++;
+        }
+        // increment the word counter
+        $this-&gt;_count[$word]++;
+      } while ($i &gt; 0);
+      // prepare to sort the word list, first we must protect
+//  words that are also used as codes. we assign them a code
+//  equivalent to the word itself.
+      // e.g. if &quot;do&quot; falls within our encoding range
+//      then we store keywords[&quot;do&quot;] = &quot;do&quot;;
+      // this avoids problems when decoding
+      $i = count($unsorted);
+      do {
+        $word = $unsorted[--$i];
+        if (isset($protected[$word]) /*!= null*/) {
+          $_sorted[$protected[$word]] = substr($word, 1);
+          $_protected[$protected[$word]] = true;
+          $this-&gt;_count[$word] = 0;
+        }
+      } while ($i);
+
+      // sort the words by frequency
+      // Note: the javascript and php version of sort can be different :
+      // in php manual, usort :
+      // &quot; If two members compare as equal,
+      // their order in the sorted array is undefined.&quot;
+      // so the final packed script is different of the Dean&#039;s javascript version
+      // but equivalent.
+      // the ECMAscript standard does not guarantee this behaviour,
+      // and thus not all browsers (e.g. Mozilla versions dating back to at
+      // least 2003) respect this.
+      usort($unsorted, array(&amp;$this, &#039;_sortWords&#039;));
+      $j = 0;
+      // because there are &quot;protected&quot; words in the list
+//  we must add the sorted words around them
+      do {
+        if (!isset($_sorted[$i])) {
+          $_sorted[$i] = substr($unsorted[$j++], 1);
+        }
+        $_encoded[$_sorted[$i]] = $values[$i];
+      } while (++$i &lt; count($unsorted));
+    }
+    return array(
+      &#039;sorted&#039; =&gt; $_sorted,
+      &#039;encoded&#039; =&gt; $_encoded,
+      &#039;protected&#039; =&gt; $_protected,
+    );
+  }
+
+  private $_count = array();
+  private function _sortWords($match1, $match2) {
+    return $this-&gt;_count[$match2] - $this-&gt;_count[$match1];
+  }
+
+  // build the boot function used for loading and decoding
+  private function _bootStrap($packed, $keywords) {
+    $ENCODE = $this-&gt;_safeRegExp(&#039;$encode\\($count\\)&#039;);
+
+    // $packed: the packed script
+    $packed = &quot;&#039;&quot; . $this-&gt;_escape($packed) . &quot;&#039;&quot;;
+
+    // $ascii: base for encoding
+    $ascii = min(count($keywords[&#039;sorted&#039;]), $this-&gt;_encoding);
+    if ($ascii == 0) {
+      $ascii = 1;
+    }
+
+    // $count: number of words contained in the script
+    $count = count($keywords[&#039;sorted&#039;]);
+
+    // $keywords: list of words contained in the script
+    foreach ($keywords[&#039;protected&#039;] as $i =&gt; $value) {
+      $keywords[&#039;sorted&#039;][$i] = &#039;&#039;;
+    }
+    // convert from a string to an array
+    ksort($keywords[&#039;sorted&#039;]);
+    $keywords = &quot;&#039;&quot; . implode(&#039;|&#039;, $keywords[&#039;sorted&#039;]) . &quot;&#039;.split(&#039;|&#039;)&quot;;
+
+    $encode = ($this-&gt;_encoding &gt; 62) ? &#039;_encode95&#039; : $this-&gt;_getEncoder($ascii);
+    $encode = $this-&gt;_getJSFunction($encode);
+    $encode = preg_replace(&#039;/_encoding/&#039;, &#039;$ascii&#039;, $encode);
+    $encode = preg_replace(&#039;/arguments\\.callee/&#039;, &#039;$encode&#039;, $encode);
+    $inline = &#039;\\$count&#039; . ($ascii &gt; 10 ? &#039;.toString(\\$ascii)&#039; : &#039;&#039;);
+
+    // $decode: code snippet to speed up decoding
+    if ($this-&gt;_fastDecode) {
+      // create the decoder
+      $decode = $this-&gt;_getJSFunction(&#039;_decodeBody&#039;);
+      if ($this-&gt;_encoding &gt; 62) {
+        $decode = preg_replace(&#039;/\\\\w/&#039;, &#039;[\\xa1-\\xff]&#039;, $decode);
+      }
+      // perform the encoding inline for lower ascii values
+      elseif ($ascii &lt; 36) {
+        $decode = preg_replace($ENCODE, $inline, $decode);
+      }
+      // special case: when $count==0 there are no keywords. I want to keep
+//  the basic shape of the unpacking funcion so i&#039;ll frig the code...
+      if ($count == 0) {
+        $decode = preg_replace($this-&gt;_safeRegExp(&#039;($count)\\s*=\\s*1&#039;), &#039;$1=0&#039;, $decode, 1);
+      }
+    }
+
+    // boot function
+    $unpack = $this-&gt;_getJSFunction(&#039;_unpack&#039;);
+    if ($this-&gt;_fastDecode) {
+      // insert the decoder
+      $this-&gt;buffer = $decode;
+      $unpack = preg_replace_callback(&#039;/\\{/&#039;, array(&amp;$this, &#039;_insertFastDecode&#039;), $unpack, 1);
+    }
+    $unpack = preg_replace(&#039;/&quot;/&#039;, &quot;&#039;&quot;, $unpack);
+    if ($this-&gt;_encoding &gt; 62) { // high-ascii
+      // get rid of the word-boundaries for regexp matches
+      $unpack = preg_replace(&#039;/\&#039;\\\\\\\\b\&#039;\s*\\+|\\+\s*\&#039;\\\\\\\\b\&#039;/&#039;, &#039;&#039;, $unpack);
+    }
+    if ($ascii &gt; 36 || $this-&gt;_encoding &gt; 62 || $this-&gt;_fastDecode) {
+      // insert the encode function
+      $this-&gt;buffer = $encode;
+      $unpack = preg_replace_callback(&#039;/\\{/&#039;, array(&amp;$this, &#039;_insertFastEncode&#039;), $unpack, 1);
+    }
+    else {
+      // perform the encoding inline
+      $unpack = preg_replace($ENCODE, $inline, $unpack);
+    }
+    // pack the boot function too
+    $unpackPacker = new JavaScriptPacker($unpack, 0, false, true);
+    $unpack = $unpackPacker-&gt;pack();
+
+    // arguments
+    $params = array($packed, $ascii, $count, $keywords);
+    if ($this-&gt;_fastDecode) {
+      $params[] = 0;
+      $params[] = &#039;{}&#039;;
+    }
+    $params = implode(&#039;,&#039;, $params);
+
+    // the whole thing
+    return &#039;eval(&#039; . $unpack . &#039;(&#039; . $params . &quot;))\n&quot;;
+  }
+
+  private $buffer;
+  private function _insertFastDecode($match) {
+    return &#039;{&#039; . $this-&gt;buffer . &#039;;&#039;;
+  }
+  private function _insertFastEncode($match) {
+    return &#039;{$encode=&#039; . $this-&gt;buffer . &#039;;&#039;;
+  }
+
+  // mmm.. ..which one do i need ??
+  private function _getEncoder($ascii) {
+    return $ascii &gt; 10 ? $ascii &gt; 36 ? $ascii &gt; 62 ?
 		       &#039;_encode95&#039; : &#039;_encode62&#039; : &#039;_encode36&#039; : &#039;_encode10&#039;;
-	}
+  }
+
+  // zero encoding
+  // characters: 0123456789
+  private function _encode10($charCode) {
+    return $charCode;
+  }
+
+  // inherent base36 support
+  // characters: 0123456789abcdefghijklmnopqrstuvwxyz
+  private function _encode36($charCode) {
+    return base_convert($charCode, 10, 36);
+  }
+
+  // hitch a ride on base36 and add the upper case alpha characters
+  // characters: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
+  private function _encode62($charCode) {
+    $res = &#039;&#039;;
+    if ($charCode &gt;= $this-&gt;_encoding) {
+      $res = $this-&gt;_encode62((int) ($charCode / $this-&gt;_encoding));
+    }
+    $charCode = $charCode % $this-&gt;_encoding;
+
+    if ($charCode &gt; 35) {
+      return $res . chr($charCode + 29);
+    }
+    else {
+      return $res . base_convert($charCode, 10, 36);
+    }
+  }
+
+  // use high-ascii values
+  // characters: ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ
+  private function _encode95($charCode) {
+    $res = &#039;&#039;;
+    if ($charCode &gt;= $this-&gt;_encoding) {
+      $res = $this-&gt;_encode95($charCode / $this-&gt;_encoding);
+    }
 
-	// zero encoding
-	// characters: 0123456789
-	private function _encode10($charCode) {
-		return $charCode;
-	}
-
-	// inherent base36 support
-	// characters: 0123456789abcdefghijklmnopqrstuvwxyz
-	private function _encode36($charCode) {
-		return base_convert($charCode, 10, 36);
-	}
-
-	// hitch a ride on base36 and add the upper case alpha characters
-	// characters: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
-	private function _encode62($charCode) {
-		$res = &#039;&#039;;
-		if ($charCode &gt;= $this-&gt;_encoding) {
-			$res = $this-&gt;_encode62((int)($charCode / $this-&gt;_encoding));
-		}
-		$charCode = $charCode % $this-&gt;_encoding;
-
-		if ($charCode &gt; 35)
-			return $res . chr($charCode + 29);
-		else
-			return $res . base_convert($charCode, 10, 36);
-	}
-
-	// use high-ascii values
-	// characters: ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ
-	private function _encode95($charCode) {
-		$res = &#039;&#039;;
-		if ($charCode &gt;= $this-&gt;_encoding)
-			$res = $this-&gt;_encode95($charCode / $this-&gt;_encoding);
-
-		return $res . chr(($charCode % $this-&gt;_encoding) + 161);
-	}
-
-	private function _safeRegExp($string) {
-		return &#039;/&#039;.preg_replace(&#039;/\$/&#039;, &#039;\\\$&#039;, $string).&#039;/&#039;;
-	}
-
-	private function _encodePrivate($charCode) {
-		return &quot;_&quot; . $charCode;
-	}
-
-	// protect characters used by the parser
-	private function _escape($script) {
-		return preg_replace(&#039;/([\\\\\&#039;])/&#039;, &#039;\\\$1&#039;, $script);
-	}
-
-	// protect high-ascii characters already in the script
-	private function _escape95($script) {
-		return preg_replace_callback(
+    return $res . chr(($charCode % $this-&gt;_encoding) + 161);
+  }
+
+  private function _safeRegExp($string) {
+    return &#039;/&#039; . preg_replace(&#039;/\$/&#039;, &#039;\\\$&#039;, $string) . &#039;/&#039;;
+  }
+
+  private function _encodePrivate($charCode) {
+    return &quot;_&quot; . $charCode;
+  }
+
+  // protect characters used by the parser
+  private function _escape($script) {
+    return preg_replace(&#039;/([\\\\\&#039;])/&#039;, &#039;\\\$1&#039;, $script);
+  }
+
+  // protect high-ascii characters already in the script
+  private function _escape95($script) {
+    return preg_replace_callback(
 			&#039;/[\\xa1-\\xff]/&#039;,
 			array(&amp;$this, &#039;_escape95Bis&#039;),
 			$script
 		);
-	}
-	private function _escape95Bis($match) {
-		return &#039;\x&#039;.((string)dechex(ord($match)));
-	}
-
-
-	private function _getJSFunction($aName) {
-		if (defined(&#039;self::JSFUNCTION&#039;.$aName))
-			return constant(&#039;self::JSFUNCTION&#039;.$aName);
-		else
-			return &#039;&#039;;
-	}
-
-	// JavaScript Functions used.
-	// Note : In Dean&#039;s version, these functions are converted
-	// with &#039;String(aFunctionName);&#039;.
-	// This internal conversion complete the original code, ex :
-	// &#039;while (aBool) anAction();&#039; is converted to
-	// &#039;while (aBool) { anAction(); }&#039;.
-	// The JavaScript functions below are corrected.
-
-	// unpacking function - this is the boot strap function
-	//  data extracted from this packing routine is passed to
-	//  this function when decoded in the target
-	// NOTE ! : without the &#039;;&#039; final.
-	const JSFUNCTION_unpack =
+  }
+  private function _escape95Bis($match) {
+    return &#039;\x&#039; . ((string) dechex(ord($match)));
+  }
+
+
+  private function _getJSFunction($aName) {
+    if (defined(&#039;self::JSFUNCTION&#039; . $aName)) {
+      return constant(&#039;self::JSFUNCTION&#039; . $aName);
+    }
+    else {
+      return &#039;&#039;;
+    }
+  }
+
+  // JavaScript Functions used.
+  // Note : In Dean&#039;s version, these functions are converted
+  // with &#039;String(aFunctionName);&#039;.
+  // This internal conversion complete the original code, ex :
+  // &#039;while (aBool) anAction();&#039; is converted to
+  // &#039;while (aBool) { anAction(); }&#039;.
+  // The JavaScript functions below are corrected.
+
+  // unpacking function - this is the boot strap function
+//  data extracted from this packing routine is passed to
+//  this function when decoded in the target
+  // NOTE ! : without the &#039;;&#039; final.
+  const JSFUNCTION_unpack =
 
 &#039;function($packed, $ascii, $count, $keywords, $encode, $decode) {
     while ($count--) {
@@ -462,17 +483,17 @@ class JavaScriptPacker {
     }
     return $packed;
 }&#039;;
-/*
-&#039;function($packed, $ascii, $count, $keywords, $encode, $decode) {
-    while ($count--)
-        if ($keywords[$count])
-            $packed = $packed.replace(new RegExp(\&#039;\\\\b\&#039; + $encode($count) + \&#039;\\\\b\&#039;, \&#039;g\&#039;), $keywords[$count]);
-    return $packed;
-}&#039;;
-*/
+  /*
+   &#039;function($packed, $ascii, $count, $keywords, $encode, $decode) {
+   while ($count--)
+   if ($keywords[$count])
+   $packed = $packed.replace(new RegExp(\&#039;\\\\b\&#039; + $encode($count) + \&#039;\\\\b\&#039;, \&#039;g\&#039;), $keywords[$count]);
+   return $packed;
+   }&#039;;
+   */
 
-	// code-snippet inserted into the unpacker to speed up decoding
-	const JSFUNCTION_decodeBody =
+  // code-snippet inserted into the unpacker to speed up decoding
+  const JSFUNCTION_decodeBody =
 //_decode = function() {
 // does the browser support String.replace where the
 //  replacement value is a function?
@@ -490,45 +511,45 @@ class JavaScriptPacker {
         $count = 1;
     }
 &#039;;
-//};
-/*
-&#039;	if (!\&#039;\&#039;.replace(/^/, String)) {
-        // decode all the values we need
-        while ($count--) $decode[$encode($count)] = $keywords[$count] || $encode($count);
-        // global replacement function
-        $keywords = [function ($encoded) {return $decode[$encoded]}];
-        // generic match
-        $encode = function () {return\&#039;\\\\w+\&#039;};
-        // reset the loop counter -  we are now doing a global replace
-        $count = 1;
-    }&#039;;
-*/
-
-	 // zero encoding
-	 // characters: 0123456789
-	 const JSFUNCTION_encode10 =
+  //};
+  /*
+   &#039;	if (!\&#039;\&#039;.replace(/^/, String)) {
+   // decode all the values we need
+   while ($count--) $decode[$encode($count)] = $keywords[$count] || $encode($count);
+   // global replacement function
+   $keywords = [function ($encoded) {return $decode[$encoded]}];
+   // generic match
+   $encode = function () {return\&#039;\\\\w+\&#039;};
+   // reset the loop counter -  we are now doing a global replace
+   $count = 1;
+   }&#039;;
+   */
+
+  // zero encoding
+  // characters: 0123456789
+  const JSFUNCTION_encode10 =
 &#039;function($charCode) {
     return $charCode;
-}&#039;;//;&#039;;
+}&#039;; //;&#039;;
 
-	 // inherent base36 support
-	 // characters: 0123456789abcdefghijklmnopqrstuvwxyz
-	 const JSFUNCTION_encode36 =
+  // inherent base36 support
+  // characters: 0123456789abcdefghijklmnopqrstuvwxyz
+  const JSFUNCTION_encode36 =
 &#039;function($charCode) {
     return $charCode.toString(36);
-}&#039;;//;&#039;;
+}&#039;; //;&#039;;
 
-	// hitch a ride on base36 and add the upper case alpha characters
-	// characters: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
-	const JSFUNCTION_encode62 =
+  // hitch a ride on base36 and add the upper case alpha characters
+  // characters: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
+  const JSFUNCTION_encode62 =
 &#039;function($charCode) {
     return ($charCode &lt; _encoding ? \&#039;\&#039; : arguments.callee(parseInt($charCode / _encoding))) +
     (($charCode = $charCode % _encoding) &gt; 35 ? String.fromCharCode($charCode + 29) : $charCode.toString(36));
 }&#039;;
 
-	// use high-ascii values
-	// characters: ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ
-	const JSFUNCTION_encode95 =
+  // use high-ascii values
+  // characters: ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþ
+  const JSFUNCTION_encode95 =
 &#039;function($charCode) {
     return ($charCode &lt; _encoding ? \&#039;\&#039; : arguments.callee($charCode / _encoding)) +
         String.fromCharCode($charCode % _encoding + 161);
@@ -538,203 +559,219 @@ class JavaScriptPacker {
 
 
 class ParseMaster {
-	public $ignoreCase = false;
-	public $escapeChar = &#039;&#039;;
+  public $ignoreCase = false;
+  public $escapeChar = &#039;&#039;;
 
-	// constants
-	const EXPRESSION = 0;
-	const REPLACEMENT = 1;
-	const LENGTH = 2;
-
-	// used to determine nesting levels
-	private $GROUPS = &#039;/\\(/&#039;;//g
-	private $SUB_REPLACE = &#039;/\\$\\d/&#039;;
-	private $INDEXED = &#039;/^\\$\\d+$/&#039;;
-	private $TRIM = &#039;/([\&#039;&quot;])\\1\\.(.*)\\.\\1\\1$/&#039;;
-	private $ESCAPE = &#039;/\\\./&#039;;//g
-	private $QUOTE = &#039;/\&#039;/&#039;;
-	private $DELETED = &#039;/\\x01[^\\x01]*\\x01/&#039;;//g
-
-	public function add($expression, $replacement = &#039;&#039;) {
-		// count the number of sub-expressions
-		//  - add one because each pattern is itself a sub-expression
-		$length = 1 + preg_match_all($this-&gt;GROUPS, $this-&gt;_internalEscape((string)$expression), $out);
-
-		// treat only strings $replacement
-		if (is_string($replacement)) {
-			// does the pattern deal with sub-expressions?
-			if (preg_match($this-&gt;SUB_REPLACE, $replacement)) {
-				// a simple lookup? (e.g. &quot;$2&quot;)
-				if (preg_match($this-&gt;INDEXED, $replacement)) {
-					// store the index (used for fast retrieval of matched strings)
-					$replacement = (int)(substr($replacement, 1)) - 1;
-				} else { // a complicated lookup (e.g. &quot;Hello $2 $1&quot;)
-					// build a function to do the lookup
-					$quote = preg_match($this-&gt;QUOTE, $this-&gt;_internalEscape($replacement))
+  // constants
+  const EXPRESSION = 0;
+  const REPLACEMENT = 1;
+  const LENGTH = 2;
+
+  // used to determine nesting levels
+  private $GROUPS = &#039;/\\(/&#039;; //g
+  private $SUB_REPLACE = &#039;/\\$\\d/&#039;;
+  private $INDEXED = &#039;/^\\$\\d+$/&#039;;
+  private $TRIM = &#039;/([\&#039;&quot;])\\1\\.(.*)\\.\\1\\1$/&#039;;
+  private $ESCAPE = &#039;/\\\./&#039;; //g
+  private $QUOTE = &#039;/\&#039;/&#039;;
+  private $DELETED = &#039;/\\x01[^\\x01]*\\x01/&#039;; //g
+
+  public function add($expression, $replacement = &#039;&#039;) {
+    // count the number of sub-expressions
+//  - add one because each pattern is itself a sub-expression
+    $length = 1 + preg_match_all($this-&gt;GROUPS, $this-&gt;_internalEscape((string) $expression), $out);
+
+    // treat only strings $replacement
+    if (is_string($replacement)) {
+      // does the pattern deal with sub-expressions?
+      if (preg_match($this-&gt;SUB_REPLACE, $replacement)) {
+        // a simple lookup? (e.g. &quot;$2&quot;)
+        if (preg_match($this-&gt;INDEXED, $replacement)) {
+          // store the index (used for fast retrieval of matched strings)
+          $replacement = (int) (substr($replacement, 1)) - 1;
+        }
+        else { // a complicated lookup (e.g. &quot;Hello $2 $1&quot;)
+          // build a function to do the lookup
+          $quote = preg_match($this-&gt;QUOTE, $this-&gt;_internalEscape($replacement))
 					         ? &#039;&quot;&#039; : &quot;&#039;&quot;;
-					$replacement = array(
-						&#039;fn&#039; =&gt; &#039;_backReferences&#039;,
-						&#039;data&#039; =&gt; array(
-							&#039;replacement&#039; =&gt; $replacement,
-							&#039;length&#039; =&gt; $length,
-							&#039;quote&#039; =&gt; $quote
-						)
-					);
-				}
-			}
-		}
-		// pass the modified arguments
-		if (!empty($expression)) $this-&gt;_add($expression, $replacement, $length);
-		else $this-&gt;_add(&#039;/^$/&#039;, $replacement, $length);
-	}
-
-	public function exec($string) {
-		// execute the global replacement
-		$this-&gt;_escaped = array();
-
-		// simulate the _patterns.toSTring of Dean
-		$regexp = &#039;/&#039;;
-		foreach ($this-&gt;_patterns as $reg) {
-			$regexp .= &#039;(&#039; . substr($reg[self::EXPRESSION], 1, -1) . &#039;)|&#039;;
-		}
-		$regexp = substr($regexp, 0, -1) . &#039;/&#039;;
-		$regexp .= ($this-&gt;ignoreCase) ? &#039;i&#039; : &#039;&#039;;
+          $replacement = array(
+            &#039;fn&#039; =&gt; &#039;_backReferences&#039;,
+            &#039;data&#039; =&gt; array(
+              &#039;replacement&#039; =&gt; $replacement,
+              &#039;length&#039; =&gt; $length,
+              &#039;quote&#039; =&gt; $quote,
+            ),
+          );
+        }
+      }
+    }
+    // pass the modified arguments
+    if (!empty($expression)) {
+      $this-&gt;_add($expression, $replacement, $length);
+    }
+    else {
+      $this-&gt;_add(&#039;/^$/&#039;, $replacement, $length);
+    }
+  }
+
+  public function exec($string) {
+    // execute the global replacement
+    $this-&gt;_escaped = array();
+
+    // simulate the _patterns.toSTring of Dean
+    $regexp = &#039;/&#039;;
+    foreach ($this-&gt;_patterns as $reg) {
+      $regexp .= &#039;(&#039; . substr($reg[self::EXPRESSION], 1, -1) . &#039;)|&#039;;
+    }
+    $regexp = substr($regexp, 0, -1) . &#039;/&#039;;
+    $regexp .= ($this-&gt;ignoreCase) ? &#039;i&#039; : &#039;&#039;;
 
-		$string = $this-&gt;_escape($string, $this-&gt;escapeChar);
-		$string = preg_replace_callback(
+    $string = $this-&gt;_escape($string, $this-&gt;escapeChar);
+    $string = preg_replace_callback(
 			$regexp,
 			array(
-				&amp;$this,
-				&#039;_replacement&#039;
-			),
+      &amp;$this,
+      &#039;_replacement&#039;,
+    ),
 			$string
 		);
-		$string = $this-&gt;_unescape($string, $this-&gt;escapeChar);
+    $string = $this-&gt;_unescape($string, $this-&gt;escapeChar);
 
-		return preg_replace($this-&gt;DELETED, &#039;&#039;, $string);
-	}
+    return preg_replace($this-&gt;DELETED, &#039;&#039;, $string);
+  }
 
-	public function reset() {
-		// clear the patterns collection so that this object may be re-used
-		$this-&gt;_patterns = array();
-	}
-
-	// private
-	private $_escaped = array();  // escaped characters
-	private $_patterns = array(); // patterns stored by index
-
-	// create and add a new pattern to the patterns collection
-	private function _add() {
-		$arguments = func_get_args();
-		$this-&gt;_patterns[] = $arguments;
-	}
-
-	// this is the global replace function (it&#039;s quite complicated)
-	private function _replacement($arguments) {
-		if (empty($arguments)) return &#039;&#039;;
-
-		$i = 1; $j = 0;
-		// loop through the patterns
-		while (isset($this-&gt;_patterns[$j])) {
-			$pattern = $this-&gt;_patterns[$j++];
-			// do we have a result?
-			if (isset($arguments[$i]) &amp;&amp; ($arguments[$i] != &#039;&#039;)) {
-				$replacement = $pattern[self::REPLACEMENT];
-
-				if (is_array($replacement) &amp;&amp; isset($replacement[&#039;fn&#039;])) {
+  public function reset() {
+    // clear the patterns collection so that this object may be re-used
+    $this-&gt;_patterns = array();
+  }
+
+  // private
+  private $_escaped = array(); // escaped characters
+  private $_patterns = array(); // patterns stored by index
+
+  // create and add a new pattern to the patterns collection
+  private function _add() {
+    $arguments = func_get_args();
+    $this-&gt;_patterns[] = $arguments;
+  }
+
+  // this is the global replace function (it&#039;s quite complicated)
+  private function _replacement($arguments) {
+    if (empty($arguments)) {
+      return &#039;&#039;;
+    }
 
-					if (isset($replacement[&#039;data&#039;])) $this-&gt;buffer = $replacement[&#039;data&#039;];
-					return call_user_func(array(&amp;$this, $replacement[&#039;fn&#039;]), $arguments, $i);
+    $i = 1;
+    $j = 0;
+    // loop through the patterns
+    while (isset($this-&gt;_patterns[$j])) {
+      $pattern = $this-&gt;_patterns[$j++];
+      // do we have a result?
+      if (isset($arguments[$i]) &amp;&amp; ($arguments[$i] != &#039;&#039;)) {
+        $replacement = $pattern[self::REPLACEMENT];
+
+        if (is_array($replacement) &amp;&amp; isset($replacement[&#039;fn&#039;])) {
+
+          if (isset($replacement[&#039;data&#039;])) {
+            $this-&gt;buffer = $replacement[&#039;data&#039;];
+          }
+          return call_user_func(array(&amp;$this, $replacement[&#039;fn&#039;]), $arguments, $i);
 
-				} elseif (is_int($replacement)) {
-					return $arguments[$replacement + $i];
+        }
+        elseif (is_int($replacement)) {
+          return $arguments[$replacement + $i];
 
-				}
-				$delete = ($this-&gt;escapeChar == &#039;&#039; ||
+        }
+        $delete = ($this-&gt;escapeChar == &#039;&#039; ||
 				           strpos($arguments[$i], $this-&gt;escapeChar) === false)
 				        ? &#039;&#039; : &quot;\x01&quot; . $arguments[$i] . &quot;\x01&quot;;
-				return $delete . $replacement;
+        return $delete . $replacement;
+
+        // skip over references to sub-expressions
+      }
+      else {
+        $i += $pattern[self::LENGTH];
+      }
+    }
+  }
+
+  private function _backReferences($match, $offset) {
+    $replacement = $this-&gt;buffer[&#039;replacement&#039;];
+    $quote = $this-&gt;buffer[&#039;quote&#039;];
+    $i = $this-&gt;buffer[&#039;length&#039;];
+    while ($i) {
+      $replacement = str_replace(&#039;$&#039; . $i--, $match[$offset + $i], $replacement);
+    }
+    return $replacement;
+  }
 
-			// skip over references to sub-expressions
-			} else {
-				$i += $pattern[self::LENGTH];
-			}
-		}
-	}
-
-	private function _backReferences($match, $offset) {
-		$replacement = $this-&gt;buffer[&#039;replacement&#039;];
-		$quote = $this-&gt;buffer[&#039;quote&#039;];
-		$i = $this-&gt;buffer[&#039;length&#039;];
-		while ($i) {
-			$replacement = str_replace(&#039;$&#039;.$i--, $match[$offset + $i], $replacement);
-		}
-		return $replacement;
-	}
-
-	private function _replace_name($match, $offset){
-		$length = strlen($match[$offset + 2]);
-		$start = $length - max($length - strlen($match[$offset + 3]), 0);
-		return substr($match[$offset + 1], $start, $length) . $match[$offset + 4];
-	}
-
-	private function _replace_encoded($match, $offset) {
-		return $this-&gt;buffer[$match[$offset]];
-	}
-
-
-	// php : we cannot pass additional data to preg_replace_callback,
-	// and we cannot use &amp;$this in create_function, so let&#039;s go to lower level
-	private $buffer;
-
-	// encode escaped characters
-	private function _escape($string, $escapeChar) {
-		if ($escapeChar) {
-			$this-&gt;buffer = $escapeChar;
-			return preg_replace_callback(
-				&#039;/\\&#039; . $escapeChar . &#039;(.)&#039; .&#039;/&#039;,
+  private function _replace_name($match, $offset) {
+    $length = strlen($match[$offset + 2]);
+    $start = $length - max($length - strlen($match[$offset + 3]), 0);
+    return substr($match[$offset + 1], $start, $length) . $match[$offset + 4];
+  }
+
+  private function _replace_encoded($match, $offset) {
+    return $this-&gt;buffer[$match[$offset]];
+  }
+
+
+  // php : we cannot pass additional data to preg_replace_callback,
+  // and we cannot use &amp;$this in create_function, so let&#039;s go to lower level
+  private $buffer;
+
+  // encode escaped characters
+  private function _escape($string, $escapeChar) {
+    if ($escapeChar) {
+      $this-&gt;buffer = $escapeChar;
+      return preg_replace_callback(
+				&#039;/\\&#039; . $escapeChar . &#039;(.)&#039; . &#039;/&#039;,
 				array(&amp;$this, &#039;_escapeBis&#039;),
 				$string
 			);
 
-		} else {
-			return $string;
-		}
-	}
-	private function _escapeBis($match) {
-		$this-&gt;_escaped[] = $match[1];
-		return $this-&gt;buffer;
-	}
-
-	// decode escaped characters
-	private function _unescape($string, $escapeChar) {
-		if ($escapeChar) {
-			$regexp = &#039;/&#039;.&#039;\\&#039;.$escapeChar.&#039;/&#039;;
-			$this-&gt;buffer = array(&#039;escapeChar&#039;=&gt; $escapeChar, &#039;i&#039; =&gt; 0);
-			return preg_replace_callback
-			(
+    }
+    else {
+      return $string;
+    }
+  }
+  private function _escapeBis($match) {
+    $this-&gt;_escaped[] = $match[1];
+    return $this-&gt;buffer;
+  }
+
+  // decode escaped characters
+  private function _unescape($string, $escapeChar) {
+    if ($escapeChar) {
+      $regexp = &#039;/&#039; . &#039;\\&#039; . $escapeChar . &#039;/&#039;;
+      $this-&gt;buffer = array(
+        &#039;escapeChar&#039; =&gt; $escapeChar,
+        &#039;i&#039; =&gt; 0,
+      );
+      return preg_replace_callback(
 				$regexp,
 				array(&amp;$this, &#039;_unescapeBis&#039;),
 				$string
 			);
 
-		} else {
-			return $string;
-		}
-	}
-	private function _unescapeBis() {
-		if (isset($this-&gt;_escaped[$this-&gt;buffer[&#039;i&#039;]])
-			&amp;&amp; $this-&gt;_escaped[$this-&gt;buffer[&#039;i&#039;]] != &#039;&#039;)
-		{
-			 $temp = $this-&gt;_escaped[$this-&gt;buffer[&#039;i&#039;]];
-		} else {
-			$temp = &#039;&#039;;
-		}
-		$this-&gt;buffer[&#039;i&#039;]++;
-		return $this-&gt;buffer[&#039;escapeChar&#039;] . $temp;
-	}
-
-	private function _internalEscape($string) {
-		return preg_replace($this-&gt;ESCAPE, &#039;&#039;, $string);
-	}
+    }
+    else {
+      return $string;
+    }
+  }
+  private function _unescapeBis() {
+    if (isset($this-&gt;_escaped[$this-&gt;buffer[&#039;i&#039;]])
+			 &amp;&amp; $this-&gt;_escaped[$this-&gt;buffer[&#039;i&#039;]] != &#039;&#039;) {
+      $temp = $this-&gt;_escaped[$this-&gt;buffer[&#039;i&#039;]];
+    }
+    else {
+      $temp = &#039;&#039;;
+    }
+    $this-&gt;buffer[&#039;i&#039;]++;
+    return $this-&gt;buffer[&#039;escapeChar&#039;] . $temp;
+  }
+
+  private function _internalEscape($string) {
+    return preg_replace($this-&gt;ESCAPE, &#039;&#039;, $string);
+  }
 }
</pre></body></head></html>