Permalink
Browse files

Minor Sanitize::escape() update

If the Datasource is not going to be used, do access it.
  • Loading branch information...
1 parent c040bb0 commit 85313e84afcbbe20045a560730097bb4d7e072f0 @styxit styxit committed Aug 15, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Utility/Sanitize.php
@@ -67,10 +67,10 @@ public static function paranoid($string, $allowed = array()) {
* @return string SQL safe string
*/
public static function escape($string, $connection = 'default') {
- $db = ConnectionManager::getDataSource($connection);
if (is_numeric($string) || $string === null || is_bool($string)) {
return $string;
}
+ $db = ConnectionManager::getDataSource($connection);
$string = $db->value($string, 'string');
$start = 1;
if ($string{0} === 'N') {

0 comments on commit 85313e8

Please sign in to comment.