LGF Technical Update

• Views: 1,181

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

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 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

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.

Jump to top

Create a PageThis is the LGF Pages posting bookmarklet. To use it, drag this button to your browser's bookmark bar, and title it 'LGF Pages' (or whatever you like). Then browse to a site you want to post, select some text on the page to use for a quote, click the bookmarklet, and the Pages posting window will appear with the title, text, and any embedded video or audio files already filled in, ready to go.
Or... you can just click this button to open the Pages posting window right away.
Last updated: 2023-04-04 11:11 am PDT
LGF User's Guide RSS Feeds

Help support Little Green Footballs!

Subscribe now for ad-free access!Register and sign in to a free LGF account before subscribing, and your ad-free access will be automatically enabled.

Donate with
PayPal
Cash.app
Recent PagesClick to refresh
The Pandemic Cost 7 Million Lives, but Talks to Prevent a Repeat Stall In late 2021, as the world reeled from the arrival of the highly contagious omicron variant of the coronavirus, representatives of almost 200 countries met - some online, some in-person in Geneva - hoping to forestall a future worldwide ...
Cheechako
6 days ago
Views: 158 • Comments: 0 • Rating: 1
Texas County at Center of Border Fight Is Overwhelmed by Migrant Deaths EAGLE PASS, Tex. - The undertaker lighted a cigarette and held it between his latex-gloved fingers as he stood over the bloated body bag lying in the bed of his battered pickup truck. The woman had been fished out ...
Cheechako
2 weeks ago
Views: 324 • Comments: 0 • Rating: 1