Skip to content

Commit 9683a0d

Browse files
authored
Fixed issue when scripts is next to the other
1 parent be1d174 commit 9683a0d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Model/Controller/ResultPlugin.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ public function aroundRenderResult(
6565
$startTag = '<script';
6666
$endTag = '</script>';
6767

68-
$start = -1;
68+
$start = 0;
6969
$i = 0;
70-
while (false !== ($start = stripos($html, $startTag, $start + 1))) {
70+
while (false !== ($start = stripos($html, $startTag, $start))) {
7171
$i++;
7272
if ($i > 1000 ) {
7373
return $result;
@@ -82,6 +82,7 @@ public function aroundRenderResult(
8282
$script = substr($html, $start, $len);
8383

8484
if (false !== stripos($script, self::EXCLUDE_FLAG_PATTERN)) {
85+
$start++;
8586
continue;
8687
}
8788

0 commit comments

Comments
 (0)