Jump to content

what does this do?


thefollower

Recommended Posts

I had already read that and it says :

 

// Processes \r\n's first so they aren't converted twice.

 

 

And then well.. why would it convert those 2 letters twice anyway i dont understand why it would need to convert anything ? Is there a dangerous security flaw with users typing \r\n's into a string which is why he replaces them ?

Link to comment
https://forums.phpfreaks.com/topic/85854-what-does-this-do/#findComment-438224
Share on other sites

On a Mac system a newline is "\r" (carriage return)

On a Nix system a newline is "\n"  (linefeed)

 

Windows however never evolved from the days of the old mechanical teletype which required the carriage to be returned back to the left hand edge and the paper fed forward, so it requires "\r\n" (carriage_return + linefeed)

 

So the code replaces all flavours with a single space,

Link to comment
https://forums.phpfreaks.com/topic/85854-what-does-this-do/#findComment-438309
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.