1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-15 11:14:12 +02:00
This commit is contained in:
Ryan Cramer
2017-01-20 11:22:29 -05:00
parent 5a8a4af23f
commit 31efae4d16

View File

@@ -410,12 +410,13 @@ class WireMarkupRegions extends Wire {
// multiple close tags present, must figure out which is the right one
$testStart = 0;
$doCnt = 0;
$openTag = "<$tagInfo[name] ";
$openTag1 = "<$tagInfo[name]>";
$openTag2 = "<$tagInfo[name] ";
do {
$doCnt++;
$testPos = stripos($region, $tagInfo['close'], $testStart);
$test = substr($region, 0, $testPos);
$openCnt = substr_count($test, $openTag);
$openCnt = substr_count($test, $openTag1) + substr_count($test, $openTag2);
$closeCnt = substr_count($test, $tagInfo['close']);
if($openCnt == $closeCnt) {
// open and close tags balance, meaning we've found our region