Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.misc > #17836

Re: What's Wrong With Newlines?

From Rich <rich@example.invalid>
Newsgroups comp.misc
Subject Re: What's Wrong With Newlines?
Date 2019-04-17 12:23 +0000
Organization A noiseless patient Spider
Message-ID <q975sc$4t6$1@dont-email.me> (permalink)
References (1 earlier) <q7m2hj$re7$4@dont-email.me> <q7m7rm$15hq$1@gioia.aioe.org> <q7mcpb$1riu$1@gioia.aioe.org> <q7nuv9$82v$2@dont-email.me> <q96j56$1qia$1@gioia.aioe.org>

Show all headers | View raw


Computer Nerd Kev <not@telling.you.invalid> wrote:
> Rich <rich@example.invalid> wrote:
>> Computer Nerd Kev <not@telling.you.invalid> wrote:
>>> 
>>> Of course to put it into HTML the newlines have to be replaced with
>>> paragraphs or line breaks. Easily done with functions like nl2br in
>>> PHP though, and surely within the means of any developer for a major
>>> website.
>> 
>> Hmm, that is also a very likely cause.  HTML ignores ASCII \n 
>> characters (treating them as nothing more than spaces).  If the message 
>> is being displayed in a web page somewhere, the programmer has to 
>> explicitly translate \n characters from the textarea into <br> or <p> 
>> tags in the resulting HTML.
>> 
>> If they just insert the raw contents of the message box into a <p>
>> (or more likely a <div>) wrapper, you end up with this effect.
> 
> I finally found cause to use one that allows you to preview the text
> before sending. Indeed the newlines, in whatever form I enter them,
> are copied straight into the HTML, inside a <div>. Manually added
> <br>s and <p>s were stripped out, which is really a good thing.
> 
> So they simply haven't cared to use a function which replaces
> newlines with <br> or <p>.

> Just lazyness 

This is likely the root cause - or at the very least not even 
considering the possibility that someone might try to enter line 
breaks.

> or a lack of testing

This is, of course, how it was never found and went out to the world.  
Most 'testers' in this context are not very creative, and often they 
just type something like "the quick brown fox jumped over the lazy dog" 
and if that ends up in the 'message', they declare pass on their tests.

But it never occurs to them to try some line breaks, or some 
punctuation (esp. punctuation that is html or sql specific) or other 
stuff, which is how so many XSS and sql injection openings get exposed 
to the world. 

> I guess, though it seems strange given that these are often very 
> major websites.

Nothing strange there.  That just confirms that their 'test folks' are 
likely more of the 'head count' variety (in order to check a box on a 
compliance form that there are testers) than the testers are real, 
good, testers that find the edge conditions.

Back to comp.misc | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

What's Wrong With Newlines? Computer Nerd Kev <not@telling.you.invalid> - 2019-03-29 01:59 +0000
  Re: What's Wrong With Newlines? Dan Espen <dan1espen@gmail.com> - 2019-03-28 23:31 -0400
    Re: What's Wrong With Newlines? not@telling.you.invalid (Computer Nerd Kev) - 2019-03-29 23:22 +0000
      Re: What's Wrong With Newlines? Mike Spencer <mds@bogus.nodomain.nowhere> - 2019-03-29 21:58 -0300
        Re: What's Wrong With Newlines? Huge <Huge@nowhere.much.invalid> - 2019-03-30 11:23 +0000
        Re: What's Wrong With Newlines? RS Wood <rsw@therandymon.com> - 2019-03-30 09:02 -0400
        Re: What's Wrong With Newlines? Kees Nuyt <k.nuyt@nospam.demon.nl> - 2019-03-30 15:24 +0100
  Re: What's Wrong With Newlines? Huge <Huge@nowhere.much.invalid> - 2019-03-29 09:32 +0000
    Re: What's Wrong With Newlines? Bob Eager <news0073@eager.cx> - 2019-03-29 09:44 +0000
      Re: What's Wrong With Newlines? not@telling.you.invalid (Computer Nerd Kev) - 2019-03-29 23:07 +0000
  Re: What's Wrong With Newlines? Rich <rich@example.invalid> - 2019-03-29 21:26 +0000
    Re: What's Wrong With Newlines? not@telling.you.invalid (Computer Nerd Kev) - 2019-03-29 22:56 +0000
      Re: What's Wrong With Newlines? Computer Nerd Kev <not@telling.you.invalid> - 2019-03-30 00:21 +0000
        Re: What's Wrong With Newlines? Rich <rich@example.invalid> - 2019-03-30 14:37 +0000
          Re: What's Wrong With Newlines? Computer Nerd Kev <not@telling.you.invalid> - 2019-04-17 07:04 +0000
            Re: What's Wrong With Newlines? Rich <rich@example.invalid> - 2019-04-17 12:23 +0000
      Re: What's Wrong With Newlines? Rich <rich@example.invalid> - 2019-03-30 14:33 +0000
    Re: What's Wrong With Newlines? scott@alfter.diespammersdie.us (Scott Alfter) - 2019-04-01 16:10 +0000

csiph-web