Fixed cleaning for long request arrays in routing and decoding with magic quotes on, closes #684 and closes #685