📢 Moderators Needed 🚀

Moderators are needed with resources to post or have access to resources to post. Submit an application to be considered.
S

RSS XF\Http\Request: Non-array-like JSON input triggers PHP error

  • Thread starter Thread starter Steffen
  • Start date Start date
S

Steffen

Guest
Guest or Bot
To reproduce, send JSON input to XenForo that PHP's json_decode function does not turn into an array (but into a string/int/boolean/...). For example:
Code:

curl -X POST -H "Content-Type: application/json" -d "true" https://xenforo.com/community/

Then XF\Http\Request::getPhpInputJson returns a scalar value (instead of an array) which causes the following error in XF\Http\Request::__construct:
Code:

Uncaught TypeError: Unsupported operand types: array + bool...

Read more

Continue reading...
 
Similar content Most view View more
Back
Top