Skip to content

Commit

Permalink
Fix JSON output comments check with content type (#3859)
Browse files Browse the repository at this point in the history
* Update FlexCollection.php

* Update FlexObject.php (#3858)
  • Loading branch information
ricardo118 authored Oct 22, 2024
1 parent d72fca1 commit 16a5076
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion system/src/Grav/Framework/Flex/FlexCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public function render(string $layout = null, array $context = [])
] + $context
);

if ($debugger->enabled() && $grav['uri']->extension() !== 'json') {
if ($debugger->enabled() && $grav['uri']->getContentType() !== 'application/json') {
$output = "\n<!–– START {$type} collection ––>\n{$output}\n<!–– END {$type} collection ––>\n";
}

Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Framework/Flex/FlexObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ public function render(string $layout = null, array $context = [])
] + $context
);

if ($debugger->enabled() && $grav['uri']->extension() !== 'json') {
if ($debugger->enabled() && $grav['uri']->getContentType() !== 'application/json') {
$name = $this->getKey() . ' (' . $type . ')';
$output = "\n<!–– START {$name} object ––>\n{$output}\n<!–– END {$name} object ––>\n";
}
Expand Down

0 comments on commit 16a5076

Please sign in to comment.