Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

Why FF uses "\n" line endings in tag textarea, but when data sent to server it uses "\r\n" line endings?

  • 2 trả lời
  • 2 gặp vấn đề này
  • 9 lượt xem
  • Trả lời mới nhất được viết bởi the-edmeister

more options

I type a text into a textarea and by using a jQuery expression: `$('textarea:first').val().replace(/\r/g, 'R').replace(/\n/g, 'N')` it shows that FF uses "\n" endings and once the form is submitted the "\n" line endings are replaced with "\r\n" line endings

The problem is in incorrect text length for multi line text - on browser side it is less due "\n" line endings and on the server side it is longer due "\r\n" line endings and raises some text length validation inconsistency between browser and server sides.

I type a text into a textarea and by using a jQuery expression: `$('textarea:first').val().replace(/\r/g, 'R').replace(/\n/g, 'N')` it shows that FF uses "\n" endings and once the form is submitted the "\n" line endings are replaced with "\r\n" line endings The problem is in incorrect text length for multi line text - on browser side it is less due "\n" line endings and on the server side it is longer due "\r\n" line endings and raises some text length validation inconsistency between browser and server sides.

Giải pháp được chọn

Hi vparamon, I do not want to say that this is a statement beyond the scope of this forum, because I know you can file a bug with troubleshooting information and steps to reproduce this with an example. However I also know it has to be reproducible. Is this unique to your server? If not please file a bug at http://bugzilla.mozilla.org with an example to make it easy to reproduce.

Đọc câu trả lời này trong ngữ cảnh 👍 3

Tất cả các câu trả lời (2)

more options

Giải pháp được chọn

Hi vparamon, I do not want to say that this is a statement beyond the scope of this forum, because I know you can file a bug with troubleshooting information and steps to reproduce this with an example. However I also know it has to be reproducible. Is this unique to your server? If not please file a bug at http://bugzilla.mozilla.org with an example to make it easy to reproduce.

more options

Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox.
http://forums.mozillazine.org/viewforum.php?f=25
You'll need to register and login to be able to post in that forum.