Live data from Hacker News

4chan source code leaked (2010)

pastebin.com

41–50 of 114 posts

Re: 4chan source code leaked (2010)

#41

I think this just goes to show that you can have a lot of popularity even if your code is just sorta glued together. Don't they get a few million users? I'd say it's definitely nothing to scoff at. It makes me wonder how many big profile websites might look like this or worse.

>I think this just goes to show that you can have a lot of popularity even if your code is just sorta glued together.

As if OpenSSL didn't prove this already.

Re: 4chan source code leaked (2010)

#42
post #9

Earlier quoted context omitted.

this makes it even more likely that it's the real code. Let's face it, no one is expecting a shining example of software design and architectural brilliance here

The original 4chan code was in Japanese and moot used Babelfish to try figure out what did what. From what I remember, the original Futaba code is just as bad ( http://www.2chan.net/script/ ). It's no secret that 4chan is cobbled together with glue and string, moot has said this several times before.

Also, moot was a teenager at the time.

Re: 4chan source code leaked (2010)

#43
post #15

Earlier quoted context omitted.

Aren't you able to hijack sessions on most webpages if you stole session cookies?

The real problem is: "extract($_POST); extract($_GET); extract($_COOKIE);" For more information on extract: http://www.php.net/extract

Docu on extract():

    Description 
       Import variables from an array into the current symbol table.
       If flags is not specified, it is assumed to be EXTR_OVERWRITE.

       EXTR_OVERWRITE
          If there is a collision, overwrite the existing variable.
The danger is that any state variables set before the extract($_...)'s can be overwritten arbitrarily. This also makes it essential that any and every variable is instantiated prior to any use.

Re: 4chan source code leaked (2010)

#44

if(isset($_COOKIE['4chan_auser'])&&isset($_COOKIE['4chan_apass'])){ $user = mysql_real_escape_string($_COOKIE['4chan_auser']); $pass = mysql_real_escape_string($_COOKIE['4chan_apass']); } HAHAHAHAAHAHAHAHAA Steal a cookie, gain access.. WTF

How do you "steal" a cookie?

Re: 4chan source code leaked (2010)

#47
post #23

F* me. No wonder PHP has a bad rap..

I think the fact that you can drive a multi million user website that was once valued at $1.2b (by a VC admittedly) on 2600 lines of pretty bad PHP code when most of the users are exactly the sort of people who'd try to hack it is actually a testament to how good PHP is.

Redeveloping the site in Go, Dart, Python or Node, or whatever language you like best, wouldn't increase 4Chan's value in any discernible way.

At the end of the day, it works.

Re: 4chan source code leaked (2010)

#48

I think this just goes to show that you can have a lot of popularity even if your code is just sorta glued together. Don't they get a few million users? I'd say it's definitely nothing to scoff at. It makes me wonder how many big profile websites might look like this or worse.

Users dont care what your code looks like,Early Facebook code was no better and look where they are now... it's about the product. Wordpress is a piece of shit from an engineering perspective yet it's the first blog engine in the world. Because its features are not that bad.

Things are different today though,people tend to use native apps, users want realtime features,hard to do that in pure PHP and scale.You often need 3rd party techs,mostly java based...

Re: 4chan source code leaked (2010)

#49

I think this just goes to show that you can have a lot of popularity even if your code is just sorta glued together. Don't they get a few million users? I'd say it's definitely nothing to scoff at. It makes me wonder how many big profile websites might look like this or worse.

Having worked at a couple, I think I wouldn't be too far off to say all of them.

I still remember a week into the first job fresh-from-college me marching into the VPs office to tell him the source code was terrible and they were only still running due to luck. It was not well received (or right)

Re: 4chan source code leaked (2010)

#50
post #11
post #5

Earlier quoted context omitted.

> It seems that it's too terrible to be the true code. 1. It's written in PHP. Finding a good PHP developer is nigh impossible (there are exceptions, like always). 2. I expected worse, to be honest.

No serious, modern PHP developer writes code like this. If it were a code sample for any respectable PHP job, it would be a massive "do not hire" flag.

Confirmation bias. 99% of PHP developers out there are in fact absolute shit, and they're happy with it because they're developing "websites" instead of "applications."

Right tool for the right job. You can use qualifiers like "serious" and "modern" but you're deluding yourself if you think they mean anything when the pool of PHP developers is so staggeringly high.

Post reply on HN