LGF Technical Update

Charles Johnsonfollow me on twitter
Tue Nov 21, 2006 at 6:00 pm PST • Views: 303

Most readers probably don’t realize that Little Green Footballs is semi-unique in the blogosphere, because the whole site runs on a custom-designed PHP platform, instead of one of the various open source or commercial blog packages. It’s a flat-file based system, which makes it very fast, and it has many security/administration features that evolved while battling some of the web’s ugliest trolls in the early days of LGF.

If you’ve noticed some oddities in the way things look at LGF for the past few days, it’s because I’ve been reworking big chunks of the LGF Blog system infrastructure, getting rid of dead code and slowly migrating toward a more XHTML and template-based framework. Man, don’t you love jargon?

In pursuit of this goal, one of the things I did was to revamp the way comments are displayed, getting rid of the HTML tables that used to enclose each comment, and replacing them with CSS-styled <div> tags. (This might help some of you whose Norton Internet Security program objects to the larger comment threads, by the way.)

Doing this, I ran into a thorny problem. When each comment was enclosed in a table, the table acted as a sort of virtual corral; if the comment contained an unclosed <b> tag, for example, the bold text only extended to the end of that table, and the unclosed tag didn’t spill over and affect the rest of the page.

When the comments are enclosed in <div> tags, however, there is no such protection. An unclosed tag affects every comment below it. Somebody forgets to close an italics tag and the whole page goes into italics mode.

And not to knock you lizardoids, but let’s face it—when there are ~3000 comments posted every day, the chances that some of them will contain malformed HTML approach statistical certainty.

So today I implemented a miniature version of the well-known (among nerds) HTML Tidy program, which fixes unclosed and unopened HTML tags, and also strips out all possible active content such as Javascript, with the help of an excellent PEAR class titled HTML_Safe.

This isn’t a challenge, by the way; I’m sure if you really work at it you can construct some HTML bad enough to confuse the HTML_Safe parser. But it should catch most of the common errors.

Since all this construction work involved modifications to lots of files, including our master CSS file, if you see anything that doesn’t look right, try emptying your browser cache and reloading the page to make sure you’re looking at the latest versions of everything.

Advertisement

1033 comments

^ back to top ^

Name:

Pass:

Register Forgot Your Password? Re-send Confirmation (To log in, cookies must be enabled in your browser!)

Turn off ads by subscribing!
For about 33 cents a day, our subscription option turns off all advertisements at LGF!
Read more...


► LGF Headlines

  • Loading...

► Tweeted Articles

  • Loading...

► Tweeted Pages

  • Loading...

► Top 10 Comments

  • Loading...

► Bottom Comments

  • Loading...

► Recent Comments

  • Loading...

► Tools/Info

► Tag Cloud

► Contact

You must have Javascript enabled to use the contact form.
Your email:

Subject:

Message:


Messages may be published in our weblog, unless you request otherwise.
Tech Note:
Using the Contact Form

More Partners

Compare Electricity Prices in your area. Texas Electricity is deregulated; you have the right to choose Texas Electric Rates from among many Texas Electric Companies.

Aquila non capit muscas.

TwitterFacebook
LGF Pages
Recent Pages

Daniel Ballard
Video and Photos: SpaceX's Rendezvous With the Space Station
2 hours, 26 minutes ago
Views: 42 • Comments: 2
Tweets: 0 • Rating: 0

Michael McBacon
Kansas governor signs 'Shariah bill' to ban Islamic law
2 hours, 44 minutes ago
Views: 92 • Comments: 5
Tweets: 0 • Rating: 3

MikeySDCA
Glenn Beck in Exile: Don't cry for the former Fox star—he's building a 24/7 media empire in his loopy image.- the Atlantic
2 hours, 46 minutes ago
Views: 58 • Comments: 0
Tweets: 0 • Rating: 0

researchok
How Did Wisconsin Become the Most Politically Divisive Place in America?
13 hours, 40 minutes ago
Views: 171 • Comments: 1
Tweets: 0 • Rating: 2

Aigle
National Geographic Traveler Veers Off Track
1 day, 2 hours ago
Views: 347 • Comments: 3
Tweets: 0 • Rating: -5

MichaelJ
Apple TV Slated to Debut in December?
1 day, 3 hours ago
Views: 180 • Comments: 0
Tweets: 0 • Rating: 1

Ascher
Israeli Who Saved Turk on Everest: You Never Abandon a Friend - Israel News, Ynetnews
1 day, 5 hours ago
Views: 239 • Comments: 1
Tweets: 0 • Rating: 3

Haywood Jabloeme
The Harrassment of Patterico & Its Roots in Left-Wing Activism
1 day, 5 hours ago
Views: 449 • Comments: 2
Tweets: 0 • Rating: 4

Curt
Brian Banks: (Video) Falsely accused of rape speaks out
1 day, 7 hours ago
Views: 216 • Comments: 1
Tweets: 0 • Rating: 3

Mickey_being_mickey
Obama Administration begins to form plan to arm Syrian rebels
1 day, 21 hours ago
Views: 212 • Comments: 2
Tweets: 0 • Rating: 1

 Frank says:

Never stop until your good becomes better, and your better becomes the best.