There was an issue with the escape function, that extra preg_replace() function was really just a temp security fix. Basti had made some changes that I did not roll into 1.5 release, I suspect this is one of them.
You should be safe with your edit, though finding a way to handle this via...