Fixed a bug in the sanitisation routine

The sanitisation of an input value would assume that the value is a string. Now it works on arrays as well.