.
OK, I'm DUMB - Grin with cat attached
Previous Entry Next Entry
OK, I'm DUMB Feb. 11th, 2006 09:15 pm

function display_html_from_user_text($input) {
$output=strip_html_tags($input);
$output=make_url_links($input);
$output=convert_newlines($output);
return($output);
}

From: topbit
Date: February 12th, 2006 - 01:17 am (Link)
It's happened to all of us before now.

I'm hitting quite a rich vein of them myself right now. Then again, I am being aided in my fubars by some of the worst code I've ever seen, though at least I don't have to develop live on the server now, like the current developers have been.
From: azekeil
Date: February 12th, 2006 - 11:16 am (Link)
Perhaps it's to make it 'safe'?
From: wechsler
Date: February 12th, 2006 - 12:34 pm (Link)
Read more closely. I didn't.
From: azekeil
Date: February 12th, 2006 - 07:46 pm (Link)
Ah, now I see it ;) Whoops :)
From: ciphergoth
Date: February 12th, 2006 - 12:35 pm (Link)
Heh. Exactly the sort of mistake you can stare at your own code for hours and not see, while another developer will notice at a glance.

The evil of imperative programming languages - this mistake would be impossible in, say, Haskell.
From: topbit
Date: February 12th, 2006 - 09:02 pm (Link)
I'm always reminded in situations like this of a Drunken programmer that was written about in .EXE magazine (by Verity Stob I think, this was probably in the late '80s).

A young mainframe programmer had been debugging a hex dump of his code for hours when a senior developer stumbles back from a four hour lunch at the pub, and after taking a couple of seconds glance at the printout, points to a few hex digits and announces "that bit's wrong", before falling over.
From: dennyd
Date: February 12th, 2006 - 04:08 pm (Link)
Oopsie :) How long did it take you?
From: wechsler
Date: February 12th, 2006 - 04:21 pm (Link)
90 minutes or so I think... "But I *know* that code's running"
From: meico
Date: February 13th, 2006 - 03:08 pm (Link)
Ouch. However, I can see how if this was you own code it would be difficult to spot... That is why I am never afraid to ask other developers for a pair of eyes.