mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 23:01:29 +00:00
Update API category display code
This commit is contained in:
@@ -10,6 +10,9 @@ use Illuminate\Http\Response;
|
||||
|
||||
final readonly class ApiV1Presenter
|
||||
{
|
||||
// JSON_HEX_TAG would turn category separators such as ">" into "\u003E".
|
||||
private const JSON_ENCODING_OPTIONS = JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
|
||||
|
||||
public function __construct(private ApiCapabilitiesService $capabilities) {}
|
||||
|
||||
/**
|
||||
@@ -40,7 +43,7 @@ final readonly class ApiV1Presenter
|
||||
if ($array === false) {
|
||||
return showApiError(201);
|
||||
}
|
||||
$body = json_encode($array, JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES);
|
||||
$body = json_encode($array, self::JSON_ENCODING_OPTIONS);
|
||||
$contentType = 'application/json';
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ use Illuminate\Support\Carbon;
|
||||
|
||||
final class ApiV2Presenter
|
||||
{
|
||||
// JSON_HEX_TAG would turn category separators such as ">" into "\u003E".
|
||||
private const JSON_ENCODING_OPTIONS = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
|
||||
|
||||
/** @param array<string, mixed> $data */
|
||||
|
||||
Reference in New Issue
Block a user