Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fixed CSS preview including PHP tags, re: #286
  • Loading branch information
lux committed Sep 11, 2018
1 parent 49ba8cc commit 0795ab5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/designer/handlers/csspreview.php
Expand Up @@ -23,7 +23,7 @@
}
}
if ($_GET['css'] && preg_match ('/^(layouts|css)\/[a-z0-9\/ _-]+\.css$/i', $_GET['css'])) {
$page->layout = str_replace ('</head>', '<style>' . file_get_contents ($_GET['css']) . '</style></head>', $page->layout);
$page->layout = str_replace ('</head>', '<style>' . strip_tags (file_get_contents ($_GET['css'])) . '</style></head>', $page->layout);
}
} else {
if (! empty ($_POST['layout'])) {
Expand All @@ -36,7 +36,7 @@
}
}
if ($_POST['css']) {
$page->layout = str_replace ('</head>', '<style>' . $_POST['css'] . '</style></head>', $page->layout);
$page->layout = str_replace ('</head>', '<style>' . strip_tags ($_POST['css']) . '</style></head>', $page->layout);
}
}

Expand Down

0 comments on commit 0795ab5

Please sign in to comment.