Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Our program, however, is still susceptible to potential misbehaving. Let’s say our user decides to call his blog post "hasOwnProperty".

This will virtually never happen. If you're worried about it, put an early return (if (name === 'hasOwnProperty') return). End of story.



Downvoted because "this will virtually never happen" is, uhm, for want of a better term, incredibly stupid.

Allow what you want to allow and disallow everything else.


Sorry, this will happen 00.0001% of the time. Orders of magnitude less than dozens of other more pressing problems.


downvoted for assuming that "chance of happening in random usage" has any correlation to what a determinated user will actually try to do.

This is like saying "oh, but nobody will ever insert SQL in our forms!"


good point.


Unless you run a blogging platform which is used by JS programmers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: