mirror of
https://github.com/getgrav/grav.git
synced 2026-02-07 07:10:30 +01:00
Merge branch 'develop' into feature/v1.8
This commit is contained in:
@@ -1407,14 +1407,13 @@ class Uri
|
||||
*/
|
||||
public function getContentType($short = true)
|
||||
{
|
||||
if (isset($_SERVER['CONTENT_TYPE'])) {
|
||||
$content_type = $_SERVER['CONTENT_TYPE'];
|
||||
$content_type = $_SERVER['CONTENT_TYPE'] ?? $_SERVER['HTTP_CONTENT_TYPE'] ?? $_SERVER['HTTP_ACCEPT'] ?? null;
|
||||
if ($content_type) {
|
||||
if ($short) {
|
||||
return Utils::substrToString($content_type, ';');
|
||||
}
|
||||
return $content_type;
|
||||
}
|
||||
return null;
|
||||
return $content_type;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -440,7 +440,8 @@ class FlexCollection extends ObjectCollection implements FlexCollectionInterface
|
||||
] + $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";
|
||||
}
|
||||
|
||||
|
||||
@@ -627,7 +627,8 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface
|
||||
] + $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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user