Jump to content
MakeWebGames

Escaping user input and losing newlines in forum posts


dnenb

Recommended Posts

Hey guys, I have a quesiton about the formatting of posts in the mccode v2 forum. It looks like the posts are stored without any newlines in the database, and I'm not sure they're being removed. Is it the magic-quotes codeblock in globals.php?

My problem is this: A player writes a post like this

blablabla

blabla

bla

But when reading the post in the forum it looks like

blablabla blabla bla
Link to comment
Share on other sites

I will look at a wysiwyg-editor, but I have a feeling that will come with problems for some of my mobile players. As for my original question: Do any of you know why I'm not getting the newlines into the db? Is it the magic-quotes in globals.php?

 

This is just a thought, maybe the output is being trimmed?

Where do you mean? I think whatever the user inputs goes through some function that removes newlines before it gets in my db.

Link to comment
Share on other sites

Where do you mean? I think whatever the user inputs goes through some function that removes newlines before it gets in my db.

Well the trim() function removes any white spaces so that might your issue, check if you can find that.

Edited by Script47
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...