Changing Sanitize::cleanValue() to enforce replacement of \r and \n with \n

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4033 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-11-30 17:40:37 +00:00
parent e712f87fc0
commit e42a93c639

View file

@ -208,10 +208,9 @@ class Sanitize{
$val = str_replace(chr(0xCA), "", $val);
//Encode any HTML to entities.
$val = $this->html($val);
//Double-check special chars and remove carriage returns
//For increased SQL security
//Double-check special chars and replace carriage returns with new lines
$val = preg_replace("/\\\$/", "$", $val);
$val = preg_replace("/\r\n/", "", $val);
$val = preg_replace("/\r\n/", "\n", $val);
$val = str_replace("!", "!", $val);
$val = str_replace("'", "'", $val);
//Allow unicode (?)