Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ARC-Support
public projects
lou-server
Commits
8d101166
Commit
8d101166
authored
Oct 01, 2021
by
Maik Messerschmidt
Browse files
Fixed a few corner cases around 'null'.
parent
4507c21c
Changes
1
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/InputController.php
View file @
8d101166
...
...
@@ -64,11 +64,16 @@ class InputController extends Controller
public
function
show
(
Input
$input
)
{
$json
=
json_decode
(
$input
->
data
);
if
(
$json
===
null
)
// Funny thing: 'null' decodes to null just as any invalid json...
// Another funny thing: response()->json(null) will return '{}'...
// (Because php can't see, whether the parameter was provided or not...)
if
(
$input
->
data
===
'null'
)
{
return
response
(
$input
->
data
)
->
header
(
'Content-Type'
,
'application/json'
);
}
else
if
(
$json
===
null
)
return
$input
->
data
;
else
return
response
()
->
json
(
$json
);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment