mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Adding fix from Ticket #2074
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4569 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
5cdb3bfc91
commit
82d0c2e742
2 changed files with 16 additions and 4 deletions
|
@ -251,12 +251,18 @@ class DboMysql extends DboSource {
|
|||
case 'boolean':
|
||||
$data = $this->boolean((bool)$data);
|
||||
break;
|
||||
case 'integer' :
|
||||
case 'float' :
|
||||
case null :
|
||||
if(is_numeric($data)) {
|
||||
break;
|
||||
}
|
||||
default:
|
||||
$data = mysql_real_escape_string($data, $this->connection);
|
||||
$data = "'" . mysql_real_escape_string($data, $this->connection) . "'";
|
||||
break;
|
||||
}
|
||||
|
||||
return "'" . $data . "'";
|
||||
return $data;
|
||||
}
|
||||
/**
|
||||
* Begin a transaction
|
||||
|
|
|
@ -225,12 +225,18 @@ class DboMysqli extends DboSource {
|
|||
case 'boolean':
|
||||
$data = $this->boolean((bool)$data);
|
||||
break;
|
||||
case 'integer' :
|
||||
case 'float' :
|
||||
case null :
|
||||
if(is_numeric($data)) {
|
||||
break;
|
||||
}
|
||||
default:
|
||||
$data = mysqli_real_escape_string($this->connection, $data);
|
||||
$data = "'" . mysqli_real_escape_string($this->connection, $data) . "'";
|
||||
break;
|
||||
}
|
||||
|
||||
return "'" . $data . "'";
|
||||
return $data;
|
||||
}
|
||||
/**
|
||||
* Begin a transaction
|
||||
|
|
Loading…
Add table
Reference in a new issue