News for hackers. Stuff that matters.
Re: by PhearTheCeal on Thursday August 29, 2013 @07:39PM (#6299318)
Looks like a poorly designed method to avoid SQL injections.
Re: by gibybo on Thursday August 29, 2013 @07:43PM (#6299329)
Doubt it - if I remember correctly, News uses its own storage engine (written on top of the file system) rather than a SQL database. Source at http://arclanguage.org/install
Re: by pigscantfly on Thursday August 29, 2013 @07:45PM (#6299335)
Even if it's not SQL oriented, it could still be to mitigate some kind of injection attack. This is an interesting question; I hope someone with more specific knowledge takes the time to answer it.
Re: by stevelosh on Thursday August 29, 2013 @09:09PM (#6299656)
like foo.com'onclick="alert('hi');"

But yeah the right way to do this is to use a well-tested urlencoding library, not to strip out dangerous-looking characters.

Re: by unono on Thursday August 29, 2013 @09:57PM (#6299802)
PG didn't use SQL. Not sure why, I would love an explanation from PG himself. He's a great programmer and can teach us something while explaining his reasoning.
Re: by fnordfnordfnord on Thursday August 29, 2013 @10:20PM (#6299867)
He did explain that at least once here. Someone brought it up about six months ago when they updated to the new Altair. Here is a related discussion from around that time. Sorry I couldn't find the one from PG. https://news.ycombinator.com/item?id=5239673

IIRC HN runs off a flat file, and doesn't use SQL, or anything else fancy simply because it isn't needed, and or because it adds unneeded complexity.

Re: by unono on Friday August 30, 2013 @12:44AM (#6300308)
Thanks, looks good. HN was built before heroku and app engine then. Nowadays, putting a db-backed site on them is pretty easy zero-admin affair.
Re: by kogir on Thursday August 29, 2013 @09:02PM (#6299629)
Nope. No SQL here.

Not to be confused with NoSQL.

Re: by staunch on Thursday August 29, 2013 @09:16PM (#6299677)
Or whether or not you know SQL
Re: by johnrob on Thursday August 29, 2013 @08:12PM (#6299429)
It might be effective though. An occasional 'Ask PG' is better than an occasional security breach.
Re: by mistercow on Thursday August 29, 2013 @08:46PM (#6299563)
Yes, but wouldn't escaping the URL properly be a better solution than either?
Re: by jfb on Thursday August 29, 2013 @08:37PM (#6299520)
I was under the impression that HN was completely invulnerable to SQL injection?
Re: by ukd1 on Thursday August 29, 2013 @09:40PM (#6299745)
It doesn't use 'database' but still has openings, it's just code afterall. FYI: security breach != sql injection.
Re: by jafaku on Thursday August 29, 2013 @09:03PM (#6299634)
Yeah, it's about time we admit HN is pretty disastrous.