Skip to content

Commit

Permalink
stripUtf8Bom() from remote JS files and inline JS/CSS. See: #69
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswsinc committed Aug 21, 2015
1 parent 2919c45 commit 9b93a93
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/includes/classes/Core.php
Expand Up @@ -1037,10 +1037,8 @@ protected function resolveResolvedCssImportsCb(array $m)
if (!empty($m['media']) && $m['media'] !== $this->current_css_media) {
return $m[0]; // Not possible; different media.
}
if (($css = $this->remote($m['url']))) {
if (($css = $this->stripUtf8Bom($css))) {
$css = $this->resolveCssRelatives($css, $m['url']);
}
if (($css = $this->stripUtf8Bom($this->remote($m['url'])))) {
$css = $this->resolveCssRelatives($css, $m['url']);
}
return $css;
}
Expand Down Expand Up @@ -1340,7 +1338,7 @@ protected function compileJsTagFragsIntoParts(array $js_tag_frags, $for)
}
} elseif ($_js_tag_frag['script_src']) {
if (($_js_tag_frag['script_src'] = $this->resolveRelativeUrl($_js_tag_frag['script_src']))) {
if (($_js_code = $this->remote($_js_tag_frag['script_src']))) {
if (($_js_code = $this->stripUtf8Bom($this->remote($_js_tag_frag['script_src'])))) {
$_js_code = rtrim($_js_code, ';').';';

if ($_js_code) {
Expand All @@ -1354,6 +1352,7 @@ protected function compileJsTagFragsIntoParts(array $js_tag_frags, $for)
}
} elseif ($_js_tag_frag['script_js']) {
$_js_code = $_js_tag_frag['script_js'];
$_js_code = $this->stripUtf8Bom($_js_code);
$_js_code = rtrim($_js_code, ';').';';

if ($_js_code) {
Expand Down

0 comments on commit 9b93a93

Please sign in to comment.