Skip to content

Commit f94c72d

Browse files
author
Vladislav Bezverkhiy
committed
Added posibility to allow smarty/blade tags
1 parent dde4c14 commit f94c72d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "a2design-inc/php-html-parser",
33
"type": "library",
4-
"version": "1.7.5",
4+
"version": "1.7.6",
55
"description": "An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.",
66
"keywords": ["html", "dom", "parser"],
77
"homepage": "https://a2design-inc/paquettg/php-html-parser",

src/PHPHtmlParser/Dom.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ protected function clean($str)
374374
$str = mb_eregi_replace("<!doctype(.*?)>", '', $str);
375375

376376
// strip out comments
377-
if ($this->options->get('removeComments')) {
377+
if (!$this->options->get('allowComments')) {
378378
$str = mb_eregi_replace("<!--(.*?)-->", '', $str);
379379
}
380380
$str = mb_eregi_replace("<!-->", '', $str);
@@ -398,7 +398,9 @@ protected function clean($str)
398398
$str = mb_eregi_replace("(<\?)(.*?)(\?>)", '', $str);
399399

400400
// strip smarty scripts
401-
$str = mb_eregi_replace("(\{\w)(.*?)(\})", '', $str);
401+
if (!$this->options->get('allowBladeTags')) {
402+
$str = mb_eregi_replace("(\{\w)(.*?)(\})", '', $str);
403+
}
402404

403405
return $str;
404406
}

0 commit comments

Comments
 (0)