0

I've been encountering this problem for a while now and I have no idea how to solve it. There is this "guestbook" that I made where people write a message and it prints out under the form. So a normal guestbook. But it sometimes strips messages from a certain point onward. Let me explain - they write something like "It was amazing, incredible, awesome performance, that should be repeated more and more." and the guestbook shows only "It was amazing, incredible, awesome performance". I have no idea what is wrong with the code nor what characters make this happen, but every now and then I see incomplete messages with a following message that says something like "The message was not send completely." and then summarizing of their previous stripped one.

nl2br(addslashes(htmlspecialchars(stripslashes($_POST['message']))))

This is the code that I use for editing messages before inputting them into the database. I took a look into the database and the messages are already stripped, so there is probably a problem with sending or editing the message rather than with printing it out of the database.

People are able to write full paragraphs that end up unstripped, so it's not a problem that occurs to everyone and everytime. There are currently about 50 messages and only 2 of them are stripped, so the stripped ones make like 4% of them all. Are there any characters that the people might eventually be using that cause the unwanted stripping? May there be a problem on the users' side? Or is there a problem with my code?

Thanks for help and any ideas in advance.

Martin
  • 1
  • 2
    just log exactly what you get from server as $_POST and you will see what is the problem - if it's a client or server side, investigate it – Flash Thunder Aug 10 '21 at 11:49
  • @FlashThunder Okay, but where can I get to the log and check it? – Martin Aug 10 '21 at 11:57
  • write it yourself with `file_put_contents('log.txt',var_export($_POST, true), FILE_APPEND);` or something like that – Flash Thunder Aug 10 '21 at 11:59
  • @FlashThunder okay, I will try it and write here what I'll have found out, thanks! – Martin Aug 10 '21 at 12:05
  • also check the size of column where are you storing info – Siddique Ahmad Aug 10 '21 at 12:57
  • Thanks @FlashThunder for your idea with a log, I found out that the characters that strip the messages are emojis such as . When an emoji occurs in a message, it gets deleted and stripped from that point onward. Thanks for you help! – Martin Aug 11 '21 at 19:25

1 Answers1

-2

Thanks @FlashThunder for your idea with a log, I found out that the characters that strip the messages are emojis such as . When an emoji occurs in a message, it gets deleted and stripped from that point onward. Thanks for you help!

Martin
  • 1