News for hackers. Stuff that matters.
Re:How to prevent a leak like Tumblr’s by nbpoole on Saturday March 19, 2011 @10:19AM (#2343633)
It physically can't: without the opening PHP tag the parser just thinks the entire file is HTML to be outputted to the browser, which is still a valid PHP file. ;)
Re:How to prevent a leak like Tumblr’s by KevBurnsJr on Saturday March 19, 2011 @10:25AM (#2343650)
I suppose you could also write a quick bash script to ensure the first 5 characters of any .class.php file matches "<?php", but it wouldn't be very generally applicable and wouldn't fix a problem like this for a file named config.php