News for hackers. Stuff that matters.
Re:How I hacked Digg by simonw on Wednesday June 04, 2008 @03:52PM (#209309)
You still need to do this:

<?php o($name); ?>

I've used this exact function in my own code, though I call it "h". Really sucks that we have to do this - not to mention that PHP's global namespace for functions means it's better to have long names that are more likely not to clash with third party code.

Re:How I hacked Digg by ojbyrne on Wednesday June 04, 2008 @06:25PM (#209448)
Actually you can use the <?= syntax to make it even more concise:

function o($name) { return(htmlspecialchars($name));}

<?=o($name)?>

which lo, and behold, looks a lot like the rails candidate below.

Re:How I hacked Digg by simonw on Wednesday June 04, 2008 @07:08PM (#209467)
You can't write code for redistribution like that though as most PHP installations have that option disabled since ti inteferes with XML processing instructions.