Fix JSON output comments check with content type (#3859)

* Update FlexCollection.php

* Update FlexObject.php (#3858)
This commit is contained in:
Ricardo Verdugo 2024-10-22 10:54:40 +01:00 committed by GitHub
parent d72fca121f
commit 16a50767dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -440,7 +440,7 @@ class FlexCollection extends ObjectCollection implements FlexCollectionInterface
] + $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";
}

View File

@ -627,7 +627,7 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface
] + $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";
}