mirror of
https://github.com/processwire/processwire.git
synced 2025-08-19 13:01:26 +02:00
Fix for debug mode warning in WireMarkupRegions plus other minor tweaks
This commit is contained in:
@@ -1140,8 +1140,10 @@ class WireMarkupRegions extends Wire {
|
||||
static $recursionLevel = 0;
|
||||
$recursionLevel++;
|
||||
$leftoverMarkup = '';
|
||||
|
||||
$debugLandmark = "<!--PW-REGION-DEBUG-->";
|
||||
$debug = $this->wire('config')->debug || strpos($htmlDocument, $debugLandmark) !== false;
|
||||
$hasDebugLandmark = strpos($htmlDocument, $debugLandmark) !== false;
|
||||
$debug = $hasDebugLandmark && $this->wire('config')->debug;
|
||||
$debugTimer = $debug ? Debug::timer() : 0;
|
||||
|
||||
if(is_array($htmlRegions)) {
|
||||
@@ -1211,6 +1213,8 @@ class WireMarkupRegions extends Wire {
|
||||
($region['actionTarget'] != $pwid ? "(target=$region[actionTarget])" : "") .
|
||||
"... $open" . ($region['close'] ? "[small]$debugBytes bytes[/small]$region[close]" : "");
|
||||
$regionNote = "$regionKey. $region[note]";
|
||||
} else {
|
||||
$regionNote = '';
|
||||
}
|
||||
|
||||
if(!$documentHasTarget) {
|
||||
@@ -1263,6 +1267,8 @@ class WireMarkupRegions extends Wire {
|
||||
} else {
|
||||
$htmlDocument .= "<!--" . $debugNotes . "\n-->";
|
||||
}
|
||||
} else if($hasDebugLandmark) {
|
||||
$htmlDocument = str_replace($debugLandmark, '', $htmlDocument);
|
||||
}
|
||||
|
||||
if(count($xregions) && $recursionLevel < 3) {
|
||||
|
Reference in New Issue
Block a user