mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Merge pull request #1529 from styxit/master
Minor Sanitize::escape() update
This commit is contained in:
commit
0f2122e4f8
1 changed files with 1 additions and 1 deletions
|
@ -67,10 +67,10 @@ class Sanitize {
|
||||||
* @return string SQL safe string
|
* @return string SQL safe string
|
||||||
*/
|
*/
|
||||||
public static function escape($string, $connection = 'default') {
|
public static function escape($string, $connection = 'default') {
|
||||||
$db = ConnectionManager::getDataSource($connection);
|
|
||||||
if (is_numeric($string) || $string === null || is_bool($string)) {
|
if (is_numeric($string) || $string === null || is_bool($string)) {
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
$db = ConnectionManager::getDataSource($connection);
|
||||||
$string = $db->value($string, 'string');
|
$string = $db->value($string, 'string');
|
||||||
$start = 1;
|
$start = 1;
|
||||||
if ($string{0} === 'N') {
|
if ($string{0} === 'N') {
|
||||||
|
|
Loading…
Add table
Reference in a new issue