From 85313e84afcbbe20045a560730097bb4d7e072f0 Mon Sep 17 00:00:00 2001 From: Floris Date: Thu, 15 Aug 2013 12:15:09 +0200 Subject: [PATCH] Minor Sanitize::escape() update If the Datasource is not going to be used, do access it. --- lib/Cake/Utility/Sanitize.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Utility/Sanitize.php b/lib/Cake/Utility/Sanitize.php index 9494ff543..d25513e32 100644 --- a/lib/Cake/Utility/Sanitize.php +++ b/lib/Cake/Utility/Sanitize.php @@ -67,10 +67,10 @@ class Sanitize { * @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') {