Skip to content

Conversation

@maltehuebner
Copy link
Contributor

Summary

  • Add empty body check before accessing $body[0] in deserializeRequestBodyToArray()

Problem

Sending a PUT/POST request with an empty body to any value/station/city API endpoint crashes with Uninitialized string offset 0 because the code accesses $body[0] without checking if the string is empty.

Test plan

  • Send empty POST to /api/value and verify a clear error instead of a crash
  • Verify normal JSON payloads still work

🤖 Generated with Claude Code

Accessing \$body[0] on an empty string throws an undefined offset
error. Add an early check that returns a clear error message instead.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant