The point is that no server configuration can save you from an error like this.
Huh? Yes you can protect against errors like this; http://news.ycombinator.com/item?id=2343675
Well, off the top of my head, mod_security has rules that scan outgoing data for password or code leakage.
A deployment strategy that requires testing that pages show what you expect them to show would also likely catch it.
The point is that no server configuration can save you from an error like this.