Just a little function which mimics the original mysql_real_escape_string but which doesn't need an active mysql connection. Could be implemented as a static function in a database class. Hope it helps someone.
function mysql_escape_mimic($inp) { if(is_array($inp)) return array_map(__METHOD__, $inp);