Adding fix for #1396.

Would not allow saving values with \ in the string

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3504 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-09-16 02:39:06 +00:00
parent 2e581426be
commit ead9f329e9
8 changed files with 29 additions and 57 deletions

View file

@ -319,10 +319,6 @@ class DboAdodb extends DboSource{
return "''"; return "''";
} }
if (ini_get('magic_quotes_gpc') == 1) {
$data = stripslashes($data);
}
return $this->_adodb->qstr($data); return $this->_adodb->qstr($data);
} }

View file

@ -267,9 +267,6 @@ class DboMssql extends DboSource {
$data = $this->boolean((bool)$data); $data = $this->boolean((bool)$data);
break; break;
default: default:
if (ini_get('magic_quotes_gpc') == 1) {
$data = stripslashes($data);
}
$data = addslashes($data); $data = addslashes($data);
break; break;
} }

View file

@ -235,9 +235,6 @@ class DboMysql extends DboSource {
$data = $this->boolean((bool)$data); $data = $this->boolean((bool)$data);
break; break;
default: default:
if (ini_get('magic_quotes_gpc') == 1) {
$data = stripslashes($data);
}
$data = mysql_real_escape_string($data, $this->connection); $data = mysql_real_escape_string($data, $this->connection);
break; break;
} }

View file

@ -228,9 +228,6 @@ class DboMysqli extends DboSource {
$data = $this->boolean((bool)$data); $data = $this->boolean((bool)$data);
break; break;
default: default:
if (ini_get('magic_quotes_gpc') == 1) {
$data = stripslashes($data);
}
$data = mysqli_real_escape_string($this->connection, $data); $data = mysqli_real_escape_string($this->connection, $data);
break; break;
} }

View file

@ -236,9 +236,6 @@ class DboOdbc extends DboSource{
return 'NULL'; return 'NULL';
} }
if (ini_get('magic_quotes_gpc') == 1) {
$data = stripslashes($data);
}
// $data = mysql_real_escape_string($data, $this->connection); // $data = mysql_real_escape_string($data, $this->connection);
if (!is_numeric($data)) { if (!is_numeric($data)) {

View file

@ -245,9 +245,6 @@ class DboPostgres extends DboSource{
break; break;
default: default:
if (ini_get('magic_quotes_gpc') == 1) {
$data = stripslashes($data);
}
$data = pg_escape_string($data); $data = pg_escape_string($data);
break; break;
} }

View file

@ -218,10 +218,6 @@ class DboSqlite extends DboSource {
$data = $this->boolean((bool)$data); $data = $this->boolean((bool)$data);
break; break;
default: default:
if (ini_get('magic_quotes_gpc') == 1)
{
$data = stripslashes($data);
}
$data = sqlite_escape_string($data); $data = sqlite_escape_string($data);
break; break;
} }

View file

@ -223,12 +223,7 @@ class DboSybase extends DboSource {
$data = $this->boolean((bool)$data); $data = $this->boolean((bool)$data);
break; break;
default: default:
if (get_magic_quotes_gpc() && trim(ini_get("magic_quotes_sybase")) == "") {
$data = stripslashes($data);
$data = str_replace("'", "''", $data); $data = str_replace("'", "''", $data);
} elseif (!get_magic_quotes_gpc()) {
$data = str_replace("'", "''", $data);
}
break; break;
} }