Este site irá ter funcionalidade limitada enquanto fazemos manutenção para melhorar a sua experiência. Se um artigo não resolve o seu problema e quiser colocar uma questão, temos a nossa comunidade de apoio à espera de o ajudar em @FirefoxSupport no Twitter, /r/firefox no Reddit.

Pesquisar no apoio

Evite burlas no apoio. Nunca iremos solicitar que telefone ou envie uma mensagem de texto para um número de telefone ou que partilhe informações pessoais. Por favor, reporte atividades suspeitas utilizando a opção "Reportar abuso".

Saber mais

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

  • 2 respostas
  • 2 têm este problema
  • 9 visualizações
  • Última resposta por 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.

Solução escolhida

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.

Ler esta resposta no contexto 👍 3

Todas as respostas (2)

more options

Solução escolhida

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.