1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-30 10:00:00 +02:00

Bump version to 3.0.49 and adjustment to debug info generated in WireMarkupRegions.php

This commit is contained in:
Ryan Cramer
2017-01-13 16:52:26 -05:00
parent 062ebd6663
commit a434f6193d
2 changed files with 6 additions and 6 deletions

View File

@@ -45,7 +45,7 @@ class ProcessWire extends Wire {
* Reversion revision number
*
*/
const versionRevision = 48;
const versionRevision = 49;
/**
* Version suffix string (when applicable)

View File

@@ -963,7 +963,8 @@ class WireMarkupRegions extends Wire {
$populatedNotes = array();
$rejectedNotes = array();
$numUpdates = 0;
$debug = $this->wire('config')->debug && $this->wire('user')->isSuperuser();
$debugLandmark = "<!--PW-REGION-DEBUG-->";
$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 = "<!--PW-REGION-DEBUG-->";
if(strpos($htmlDocument, $landmark) !== false) {
$debugNotes = "<pre>" . $this->wire('sanitizer')->entities($debugNotes) . "</pre>" . $landmark;
$htmlDocument = str_replace($landmark, $debugNotes, $htmlDocument);
if(strpos($htmlDocument, $debugLandmark) !== false) {
$debugNotes = "<pre>" . $this->wire('sanitizer')->entities($debugNotes) . "</pre>" . $debugLandmark;
$htmlDocument = str_replace($debugLandmark, $debugNotes, $htmlDocument);
} else {
$htmlDocument .= "<!--" . $debugNotes . "\n-->";
}