Skip to content

Commit 7d29851

Browse files
KristofMorvataylorotwell
authored andcommitted
Allow options to be 0 for @JSON (#21692)
1 parent 2f6e25b commit 7d29851

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Illuminate/View/Compilers/Concerns/CompilesJson.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ protected function compileJson($expression)
2121
{
2222
$parts = explode(',', $this->stripParentheses($expression));
2323

24-
$options = trim($parts[1] ?? $this->encodingOptions);
24+
$options = isset($parts[1]) ? trim($parts[1]) : $this->encodingOptions;
2525

26-
$depth = trim($parts[2] ?? 512);
26+
$depth = isset($parts[2]) ? trim($parts[2]) : 512;
2727

2828
return "<?php echo json_encode($parts[0], $options, $depth) ?>";
2929
}

0 commit comments

Comments
 (0)