Fix security issue mentioned on http://www.phpsadness.com/sad/47