Skip to content

Commit

Permalink
fix for markdown adding HTML tags into inline JS/CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Feb 3, 2015
1 parent 0250893 commit 3f33e97
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions system/src/Grav/Common/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ public function addJs($asset, $priority = 10, $pipeline = true)
*/
public function addInlineCss($asset, $priority = 10)
{
$asset = (string) $asset;
if (is_a($asset, 'Twig_Markup')) {
$asset = strip_tags((string)$asset);
}
$key = md5($asset);
if (is_string($asset) && !array_key_exists($key, $this->inline_css)) {
$this->inline_css[$key] = [
Expand All @@ -327,7 +329,9 @@ public function addInlineCss($asset, $priority = 10)
*/
public function addInlineJs($asset, $priority = 10)
{
$asset = (string) $asset;
if (is_a($asset, 'Twig_Markup')) {
$asset = strip_tags((string)$asset);
}
$key = md5($asset);
if (is_string($asset) && !array_key_exists($key, $this->inline_js)) {
$this->inline_js[$key] = [
Expand Down

0 comments on commit 3f33e97

Please sign in to comment.