Skip to content

Commit

Permalink
Fallback to extension on Flex-Objects json check
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Oct 22, 2024
1 parent f686e0a commit 6fa6319
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']->getContentType() !== 'application/json') {
if ($debugger->enabled() && ($grav['uri']->getContentType() !== 'application/json' || $grav['uri']->extension() !== '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']->getContentType() !== 'application/json') {
if ($debugger->enabled() && ($grav['uri']->getContentType() !== 'application/json' || $grav['uri']->extension() !== 'json')) {
$name = $this->getKey() . ' (' . $type . ')';
$output = "\n<!–– START {$name} object ––>\n{$output}\n<!–– END {$name} object ––>\n";
}
Expand Down

0 comments on commit 6fa6319

Please sign in to comment.