1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 18:24:57 +02:00
This commit is contained in:
Ryan Cramer
2019-03-28 05:52:44 -04:00
parent f7b99d7676
commit ce8c369510

View File

@@ -545,8 +545,8 @@ class WireMarkupRegions extends Wire {
$testStart = 0;
$doCnt = 0;
$maxDoCnt = 100000;
$openTag1 = "<$tagInfo[name]>";
$openTag2 = "<$tagInfo[name] ";
$openTag = "<$tagInfo[name]";
$openTags = array("$openTag>", "$openTag ", "$openTag\n", "$openTag\r", "$openTag\t");
$fail = false;
do {
@@ -557,7 +557,10 @@ class WireMarkupRegions extends Wire {
break;
}
$test = substr($region, 0, $testPos);
$openCnt = substr_count($test, $openTag1) + substr_count($test, $openTag2);
$openCnt = 0;
foreach($openTags as $openTag) {
if(strpos($test, $openTag) !== false) $openCnt += substr_count($test, $openTag);
}
$closeCnt = substr_count($test, $tagInfo['close']);
if($openCnt == $closeCnt) {
// open and close tags balance, meaning we've found our region