kennym / cf7-to-api

LOOKING FOR MAINTAINER. Wordpress plugin to transmit contact form 7 entries to remote API using POST or GET
https://wordpress.org/plugins/cf7-to-api-basic-auth/
52 stars 30 forks source link

make sure all fields are correctly JSON encoded #46

Closed ralfbecker closed 2 years ago

ralfbecker commented 3 years ago

If the content of the form fields contain eg. double quotes or backslashes, they break the JSON encoding of the request.

This pull request fixes that by always using json_encode, not only for files but all values.

Example: 'Test"Ralf' --> "Test\"Ralf" without: "Test"Ralf" which is obviously not ok.

Ralf