Also, don't restrict allowed characters unnecessarily. It's just stupid to have "Use special characters, but only !$() and _ are allowed!". God, why?
I think in general the advice is that there should not be any limitations on special characters anywhere in the tech stack at all. (Including a broken UI that won't let you input special characters.)
The situation you described sounds more to me like a very poorly written application.