来自mozilla的用户提交的内容充满了随机换行符

I've been building a site where users submit a logline and a synopsis for something. This works through a that is then submitted using $_POST, and an SQL query is used to put it into an SQL table. For some reason, ONLY IN MOZILLA FIREFOX (I've tested in chrome, IE, safari, and even on an ipad (Safari again)), by the time it gets to the SQL table it is full of random line breaks. When the submission is viewed on a different part of the site, no matter what the line breaks are there, so it is definitely a problem with Mozilla with the submission step.

So what is the issue with Mozilla? I would love any help on making this not happen, here is what is being submitted (abridged to include relevant pieces):

User enters value in this kind of a textarea:

<form id="submitform" name="submitform" action="submit.php" onsubmit="return validateSubmitForm(event)" method="post">

    // some code

        <textarea style="height:300px;width:800px;font-family:Arial;border:1px solid #a6a6a6;
                         background-color:#fff9eb;resize:none" 
                  wrap="hard" size="1500" placeholder="1500 character limit..." maxlength="1500"
                  id="submitsummary" name="submitsummary" type="text"></textarea>

    // some code

</form>

Then, after the form is submitted as a $_POST, I input it into the data table with basically this SQL query:

"INSERT INTO table (userid, header, synopsis) 
VALUES(1, 1, " . htmlspecialchars($_POST["submitsummary"]) . ")"

Any thoughts on why it is that only Mozilla is being problematic? Also, any thoughts on how to get around it? Much appreciated!

wrap="hard" is known to have issues with Firefox. Remove that and check if the random line breaks disappear.

Also set the cols and rows attributes for the textbox as Firefox also uses this to determine proper wrapping.

I suspect your issue is wrap="hard". This requires you to use the cols attribute and it inserts newlines at the wrap points of text in the textarea.

Removing the wrap or setting wrap="soft" will result in the submitted data only having newlines where the user hit enter (or if the user pasted, only where the pasted data had newlines).