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:
@@ -45,7 +45,7 @@ class ProcessWire extends Wire {
|
||||
* Reversion revision number
|
||||
*
|
||||
*/
|
||||
const versionRevision = 48;
|
||||
const versionRevision = 49;
|
||||
|
||||
/**
|
||||
* Version suffix string (when applicable)
|
||||
|
@@ -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-->";
|
||||
}
|
||||
|
Reference in New Issue
Block a user