Minor Sanitize::escape() update

If the Datasource is not going to be used, do access it.
This commit is contained in:
Floris 2013-08-15 12:15:09 +02:00
parent c040bb0cdc
commit 85313e84af

View file

@ -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') {