Ayoub M.
Ayoub M.

Reputation: 4808

"\r" in html made by cakePHP Sanitize::clean()

I used Sanitize::clean in cakePHP to sanitize user input and in result I got "\r" character.

  1. What does this character mean ("\r") ?
  2. Is there a function that does the reverse of Sanitize::clean, so I can use before outputting the data.

Upvotes: 0

Views: 1369

Answers (2)

brettkelly
brettkelly

Reputation: 28215

You can get rid of this character (and others) by calling trim($userInput); or this way using Sanitize::clean :

$opts = array('carriage'=>true);
$cleaned = Sanitize::clean($userInput,$opts);

Upvotes: 1

Eric J.
Eric J.

Reputation: 150138

"\r" is the Carriage Return character (when printing to the console, it causes output to start on the next line but does not affect display of web pages).

Upvotes: 1

Related Questions