What the heck, are people actually arguing against using template engines? It's just the same as SQL, if you don't force people to use prepared statements, they'll create SQL injection holes all over the place.
The right way to template nowadays is to auto escape everything and explicitely mark stuff as safe if needed and enable CSRF-protection by default - HTML isn't as safe as 10 years ago as everyone knows how to exploit any holes you leave in the code. (Examples are python based, PHP was too long ago for me)
The scary thing is that embedding <img src="http://yoursite/delete/everything"> to execute commands with the logged in user still works on a lot of sites. Even if you check for POST, there are ways around that; if any page echos anything from the request url back to the page, you can echo a <script> tag and execute a POST on the same domain. Usually it's a debug page left on the server - they aren't harmless, they are landmines.
Rewrite everything to index.php?path=$path so random .php's cannot be called, force everything through a template engine that takes care of escaping and CSRF and you'll have a chance to create a secure site. Otherwise, one missing htmlescapechars() can lead to disaster.
The right way to template nowadays is to auto escape everything and explicitely mark stuff as safe if needed and enable CSRF-protection by default - HTML isn't as safe as 10 years ago as everyone knows how to exploit any holes you leave in the code. (Examples are python based, PHP was too long ago for me)
The scary thing is that embedding <img src="http://yoursite/delete/everything"> to execute commands with the logged in user still works on a lot of sites. Even if you check for POST, there are ways around that; if any page echos anything from the request url back to the page, you can echo a <script> tag and execute a POST on the same domain. Usually it's a debug page left on the server - they aren't harmless, they are landmines.
Rewrite everything to index.php?path=$path so random .php's cannot be called, force everything through a template engine that takes care of escaping and CSRF and you'll have a chance to create a secure site. Otherwise, one missing htmlescapechars() can lead to disaster.