Skip to content

Commit 17a7d7c

Browse files
Update React.php
1 parent 77c50cd commit 17a7d7c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

React.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ function render(){
9797
$attributes = implode(' ',$attr);
9898

9999
//if theres innerHtml then ignore children else escape any string passed as html
100-
$children = $innerHtml ? [$innerHtml] : array_map(function($v){ return is_string($v) ? htmlspecialchars($v) : $v; }, $this->children);
100+
$children = $innerHtml ? [$innerHtml] :
101+
array_map(function($v)use($tag){ return is_string($v) && $tag!='script' ? htmlspecialchars($v) : $v; }, $this->children);
101102
$children = implode('', $children);
102103

103104
return "<$tag $attributes>$children</$tag>";

0 commit comments

Comments
 (0)