Add function for checking options arrays for SQL injection

Now used anywhere where external options are accepted

Change-Id: I8749aab2242fa29e4f3f47af07a7427cd3eefaa4