Feedback Need help with a Forums feature, noticed a broken link (or other site problem) or just have a general question - this is the spot

New HTML filtering code

Thread Tools
 
Search this Thread
 
Old May 22, 2001 | 02:12 PM
  #1  
Johannes Erdfelt's Avatar
Thread Starter
Member
 
Joined: Mar 2000
Posts: 3,401
Likes: 0
Default New HTML filtering code

I've implemented some new HTML filtering code. It's active on the forums now and you may have seen some subtle changes.

It is a bit more pedantic about correct HTML. It'll rebuild all HTML tags in your message now to make sure the tag is correct and not allow anything we don't want into it. You may see things like border=0 turned into border="0".

Also, it validates all URL's where applicable. This means no more javascript.

It may also reorder the attributes while rebuilding the tag. This is just a quirk of the algorithm I implemented. It's harmless.

If for some reason the code doesn't like your HTML tags, or you just casually use < and > in your message, it will convert the brackets into the appropriate SGML entities, instead of ignoring them or stripping them out like before.

I've done some extensive testing of the code and it seems to be working correctly in all cases now. If you see anything weird, please follow up.

I'll be scrubbing all of the existing messages and all of the existing signatures soon. I've been testing my code on the existing signatures and have found hundreds of mistakes people have made. Be forewarned that your signature may break soon if you have invalid HTML.
Reply
Old May 23, 2001 | 12:16 PM
  #2  
muhammadc's Avatar
Junior Member
 
Joined: May 2000
Posts: 1,983
Likes: 0
Default What exactly is allowed?

For example, a font size in your signature can't be changed (although it could at one time) ... are there specific codes you do and do not allow? Seems like images and links, and just simple text code works, but once you get beyond that it doesn't.
Reply
Old May 23, 2001 | 10:00 PM
  #3  
Johannes Erdfelt's Avatar
Thread Starter
Member
 
Joined: Mar 2000
Posts: 3,401
Likes: 0
Default Here's the exhaustive list:

<a href="" target=""></a>
<img src="" border="" alt="">
<font color=""></font>
<b></b>
<i></i>
<u></u>
<tt></tt>
<big></big>
<small></small>

We check href and src for a valid URL, target can only be a couple of common ones (_top, _new, etc) and border can only be a number.

Any suggestions for more? The new code can control attributes much better now. I'm thinking maybe <pre></pre>?

The only thing is it can't handle forcing of nesting of tags (ie tables) correctly. It'll handle arbitrary nested tags, just won't force a specific ordering.
Reply
Old May 24, 2001 | 11:46 AM
  #4  
hwj's Avatar
hwj
AudiWorld Super User
 
Joined: Mar 2000
Posts: 17,068
Likes: 0
From: San Jose, CA
Default What about...

Hey, Johannes. Can you please allow the <tt>width</tt> and <tt>height</tt> attributes for <tt>img</tt> tags? I've always used them in the past when I post pics, as it will cause most people's browsers to lay out the page much quicker when it knows how big the image placeholder needs to be before it even starts loading the image file.
Reply
Old May 24, 2001 | 01:27 PM
  #5  
Johannes Erdfelt's Avatar
Thread Starter
Member
 
Joined: Mar 2000
Posts: 3,401
Likes: 0
Default I was hesitant to allow height and width tags because people might abuse them

How about I put a restriction on them? Max of 1280 by 1024?
Reply
Old May 24, 2001 | 02:20 PM
  #6  
hwj's Avatar
hwj
AudiWorld Super User
 
Joined: Mar 2000
Posts: 17,068
Likes: 0
From: San Jose, CA
Default Hmm.

Do you really think people would abuse them? Are you mostly concerned with the newbie-type who likes to post a dozen image links to 1600x1200 images and then setting the width and height in the tag to 160x120? ("Look, everybody! I made thumbnails!" NOT.)
Reply
Old May 25, 2001 | 06:47 PM
  #7  
Johannes Erdfelt's Avatar
Thread Starter
Member
 
Joined: Mar 2000
Posts: 3,401
Likes: 0
Default

That is one possibility. I also don't want people to make the picture 160000x120000
Reply
Old May 25, 2001 | 08:05 PM
  #8  
hwj's Avatar
hwj
AudiWorld Super User
 
Joined: Mar 2000
Posts: 17,068
Likes: 0
From: San Jose, CA
Default In that case, I would vote in favor of limits.

Strip out the height and width tags if they try to make it larger than, say, 1600x1200 (a common digiam resolution).
Reply
AudiWorld Stories

Bringing Audi to Life for Audi Fans

story-0

Audi Unveils Absurdly Cool New Supercar: 10 Things You Need to Know!

 Verdad Gallardo
story-1

The Highs & Lows of Every Audi C-Class Generation

 Joe Kucinski
story-2

Top 10 Most Expensive Audis Ever Sold on Bring-A-Trailer

 Brett Foote
story-3

10 Audi Features & Options We Miss the Most!

 Joe Kucinski
story-4

Audi Recreates Crazy-Looking Speed Record Breaker From 1935

 Verdad Gallardo
story-5

Coachbuilder Recreates the 1995 Audi TTS Concept

 Verdad Gallardo
story-6

Every Audi V10 Car Ranked!

 Joe Kucinski
story-7

9 Audi Designs That Aged Like Fine Wine

 Verdad Gallardo
story-8

2026 Audi Q5 Buyer's Guide (Every Model Explained)

 Brett Foote
story-9

Ranking Every Current Audi 'S' Model From Worst to First!

 Joe Kucinski
Old May 26, 2001 | 06:44 PM
  #9  
Johannes Erdfelt's Avatar
Thread Starter
Member
 
Joined: Mar 2000
Posts: 3,401
Likes: 0
Default I can live with 1600x1200. I can also automatically fill in the width/height for pictureposter pics

Dunno what to about "resizing" with width/height tags tho.
Reply
Old May 26, 2001 | 09:00 PM
  #10  
hwj's Avatar
hwj
AudiWorld Super User
 
Joined: Mar 2000
Posts: 17,068
Likes: 0
From: San Jose, CA
Default Having it automagically add the size tags would be wicked cool, Johannes.

Should make everyone's browsing experience better.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Cmmartin23
Parts For Sale - Archive (NO NEW POSTS HERE)
26
Aug 23, 2016 04:44 PM
saifxnyc
A6 / S6 (C6 Platform) Discussion
9
Nov 30, 2015 12:32 PM
CPLYONS
A8 / S8 (D3 Platform) Discussion
0
Sep 5, 2015 05:48 PM
CPLYONS
A8 / S8 (D3 Platform) Discussion
3
Sep 3, 2015 07:04 PM
Powerofbabel
Parts For Sale - Archive (NO NEW POSTS HERE)
0
Sep 2, 2015 10:08 AM




All times are GMT -8. The time now is 07:08 PM.

story-0
Audi Unveils Absurdly Cool New Supercar: 10 Things You Need to Know!

Slideshow: Limited to just 499 units, the 987-horsepower halo car signals a new chapter for Audi performance.

By Verdad Gallardo | 2026-06-04 17:37:15


VIEW MORE
story-1
The Highs & Lows of Every Audi C-Class Generation

Slideshow: The highs and lows of every Audi C-Class generation.

By Joe Kucinski | 2026-05-27 16:05:50


VIEW MORE
story-2
Top 10 Most Expensive Audis Ever Sold on Bring-A-Trailer

People were more than happy to shell out big bucks for these cars.

By Brett Foote | 2026-05-27 15:32:23


VIEW MORE
story-3
10 Audi Features & Options We Miss the Most!

Slideshow: 10 Audi features and options we miss the most.

By Joe Kucinski | 2026-05-12 19:33:47


VIEW MORE
story-4
Audi Recreates Crazy-Looking Speed Record Breaker From 1935

Slideshow: Audi has recreated one of the wildest machines of the pre-war speed-record era, reviving a streamlined V16 racer that originally exceeded 200 mph in 1935.

By Verdad Gallardo | 2026-05-11 09:49:34


VIEW MORE
story-5
Coachbuilder Recreates the 1995 Audi TTS Concept

Slideshow: A Dutch coachbuilder has reimagined the original Audi TT by finishing what the 1995 concept only hinted at.

By Verdad Gallardo | 2026-05-05 15:17:58


VIEW MORE
story-6
Every Audi V10 Car Ranked!

Slideshow: Ranking every Audi V10 road car

By Joe Kucinski | 2026-04-29 16:11:56


VIEW MORE
story-7
9 Audi Designs That Aged Like Fine Wine

Slideshow: A look back at the Audis that didn't just survive changing tastes, they quietly outgrew them.

By Verdad Gallardo | 2026-04-28 19:38:27


VIEW MORE
story-8
2026 Audi Q5 Buyer's Guide (Every Model Explained)

One year off a full redesign, the best-selling Q5 is getting a few more updates.

By Brett Foote | 2026-04-17 09:56:19


VIEW MORE
story-9
Ranking Every Current Audi 'S' Model From Worst to First!

Slideshow: Ranking every current Audi 'S' model on sale today from worst to best.

By Joe Kucinski | 2026-04-16 10:28:28


VIEW MORE