Skip to content

Commit

Permalink
- **Enhancing Exclusion Tests:** Now testing exclusion rules against …
Browse files Browse the repository at this point in the history
…full open tag instead of only the CSS or JS URL and content. This allows for exclusion rules that exclude CSS or JS based on an opening tag attribute; e.g., `<style id='rs-plugin-settings-inline-css'`. See also: [this Comet Cache issue](wpsharks/comet-cache#614).
  • Loading branch information
jaswsinc committed Nov 8, 2016
1 parent 3d77bc0 commit 91d610a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ project_title = WebSharks HTML Compressor
project_owner = websharks
project_slug = html-compressor

project_text_domain = html-compressor
project_slack_channel = html-compressor

project_namespace = WebSharks\\HtmlCompressor
project_sub_namespace = HtmlCompressor

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## $v

- **Enhancing Exclusion Tests:** Now testing exclusion rules against full open tag instead of only the CSS or JS URL and content. This allows for exclusion rules that exclude CSS or JS based on an opening tag attribute; e.g., `<style id='rs-plugin-settings-inline-css'`. See also: [this Comet Cache issue](https://github.com/websharks/comet-cache/issues/614).

## v160118

- Adding support for URI exclusions. See: https://github.com/websharks/zencache/issues/651
Expand Down
2 changes: 1 addition & 1 deletion phings
Submodule phings updated from 913447 to 70dcec
8 changes: 4 additions & 4 deletions src/includes/classes/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,9 @@ protected function getCssTagFrags(array $html_frag)
$_tag_frag_r['exclude'] = true;
} elseif ($_tag_frag_r['link_href'] && $_tag_frag_r['link_href_external'] && isset($this->options['compress_combine_remote_css_js']) && !$this->options['compress_combine_remote_css_js']) {
$_tag_frag_r['exclude'] = true;
} elseif ($this->regex_css_exclusions && preg_match($this->regex_css_exclusions, $_tag_frag_r['link_href'].$_tag_frag_r['style_css'])) {
} elseif ($this->regex_css_exclusions && preg_match($this->regex_css_exclusions, $_tag_frag_r['link_self_closing_tag'].' '.$_tag_frag_r['style_open_tag'].' '.$_tag_frag_r['style_css'])) {
$_tag_frag_r['exclude'] = true;
} elseif ($this->built_in_regex_css_exclusions && preg_match($this->built_in_regex_css_exclusions, $_tag_frag_r['link_href'].$_tag_frag_r['style_css'])) {
} elseif ($this->built_in_regex_css_exclusions && preg_match($this->built_in_regex_css_exclusions, $_tag_frag_r['link_self_closing_tag'].' '.$_tag_frag_r['style_open_tag'].' '.$_tag_frag_r['style_css'])) {
$_tag_frag_r['exclude'] = true;
}
}
Expand Down Expand Up @@ -1668,9 +1668,9 @@ protected function getJsTagFrags(array $html_frag)
$_tag_frag_r['exclude'] = true;
} elseif ($_tag_frag_r['script_src'] && $_tag_frag_r['script_src_external'] && isset($this->options['compress_combine_remote_css_js']) && !$this->options['compress_combine_remote_css_js']) {
$_tag_frag_r['exclude'] = true;
} elseif ($this->regex_js_exclusions && preg_match($this->regex_js_exclusions, $_tag_frag_r['script_src'].$_tag_frag_r['script_js'].$_tag_frag_r['script_json'])) {
} elseif ($this->regex_js_exclusions && preg_match($this->regex_js_exclusions, $_tag_frag_r['script_open_tag'].' '.$_tag_frag_r['script_js'].$_tag_frag_r['script_json'])) {
$_tag_frag_r['exclude'] = true;
} elseif ($this->built_in_regex_js_exclusions && preg_match($this->built_in_regex_js_exclusions, $_tag_frag_r['script_src'].$_tag_frag_r['script_js'].$_tag_frag_r['script_json'])) {
} elseif ($this->built_in_regex_js_exclusions && preg_match($this->built_in_regex_js_exclusions, $_tag_frag_r['script_open_tag'].' '.$_tag_frag_r['script_js'].$_tag_frag_r['script_json'])) {
$_tag_frag_r['exclude'] = true;
}
}
Expand Down

0 comments on commit 91d610a

Please sign in to comment.