PHP: POST data + apostrophes
Imagine the following:
- Form data contains an apostrophe
- Form is being sent
- POST data becomes serialized
- POST data is written to the database
- Database data is retrieved
- Data cannot be unserialized
The problem was found in the serialized data. I tried without and with apostrophe:
- s: 7: "company"; s: 12: "Joes Company"
- s: 7: "company"; s: 14: "Joe's Company"
I know the POST data has added forward slashes in quotes and apostrophes, but somewhere my forward slashes are being removed which breaks serialization. I am not using stripslashes () function anywhere - any ideas?
+2
Joe
source
to share