diff --git a/include/dba.php b/include/dba.php index ae3a4957b6..98823df3ae 100644 --- a/include/dba.php +++ b/include/dba.php @@ -114,7 +114,10 @@ function dbg($state) { if(! function_exists('dbesc')) { function dbesc($str) { global $db; - return($db->escape($str)); + if($db) + return($db->escape($str)); + else + return(str_replace("'","\\'",$str)); }}