Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.5] Allow @json options to be 0 #21692

Merged
merged 1 commit into from
Oct 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Allow options to be 0 for @JSON
  • Loading branch information
KristofMorva committed Oct 16, 2017
commit d4a753e28c80b9b02351c4a06d611b81b1cd6658
4 changes: 2 additions & 2 deletions src/Illuminate/View/Compilers/Concerns/CompilesJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ protected function compileJson($expression)
{
$parts = explode(',', $this->stripParentheses($expression));

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

$depth = trim($parts[2] ?? 512);
$depth = isset($parts[2]) ? trim($parts[2]) : 512;

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