From a434f6193d6058aa62843906798003fbbeb6daba Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 13 Jan 2017 16:52:26 -0500 Subject: [PATCH] Bump version to 3.0.49 and adjustment to debug info generated in WireMarkupRegions.php --- wire/core/ProcessWire.php | 2 +- wire/core/WireMarkupRegions.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wire/core/ProcessWire.php b/wire/core/ProcessWire.php index c8ae8225..2d3bee51 100644 --- a/wire/core/ProcessWire.php +++ b/wire/core/ProcessWire.php @@ -45,7 +45,7 @@ class ProcessWire extends Wire { * Reversion revision number * */ - const versionRevision = 48; + const versionRevision = 49; /** * Version suffix string (when applicable) diff --git a/wire/core/WireMarkupRegions.php b/wire/core/WireMarkupRegions.php index 9f6e0f16..4256174f 100644 --- a/wire/core/WireMarkupRegions.php +++ b/wire/core/WireMarkupRegions.php @@ -963,7 +963,8 @@ class WireMarkupRegions extends Wire { $populatedNotes = array(); $rejectedNotes = array(); $numUpdates = 0; - $debug = $this->wire('config')->debug && $this->wire('user')->isSuperuser(); + $debugLandmark = ""; + $debug = ($this->wire('config')->debug || strpos($htmlDocument, $debugLandmark)) && $this->wire('user')->isSuperuser(); foreach($regions as $regionKey => $region) { @@ -1016,10 +1017,9 @@ class WireMarkupRegions extends Wire { if(count($populatedNotes)) $debugNotes .= "\n Populated: $bull" . implode($bull, $populatedNotes); if(count($rejectedNotes)) $debugNotes .= "\n Skipped: $bull" . implode($bull, $rejectedNotes); if($leftoverBytes) $debugNotes .= "\n $leftoverBytes non-region bytes skipped"; - $landmark = ""; - if(strpos($htmlDocument, $landmark) !== false) { - $debugNotes = "
" . $this->wire('sanitizer')->entities($debugNotes) . "
" . $landmark; - $htmlDocument = str_replace($landmark, $debugNotes, $htmlDocument); + if(strpos($htmlDocument, $debugLandmark) !== false) { + $debugNotes = "
" . $this->wire('sanitizer')->entities($debugNotes) . "
" . $debugLandmark; + $htmlDocument = str_replace($debugLandmark, $debugNotes, $htmlDocument); } else { $htmlDocument .= ""; }