|
Re: You are Under Attack
|
Posted: Feb 27, 2004 1:05 AM
|
|
> I've said it: > http://www.livejournal.com/~mannu/111862.html
I see what you said was:
If you allow users to edit the content of your website, exercise strict control over it. See how Slashdot does user comments. See UseMod's text formatting rules. You don't want users to be able to inject malicious JavaScript code into your website. As much as possible, limit user contributions to plain text. Plain text rules.
That's actually what I originally did with the Artima weblogs. Originally, blog posts were typed in with the same square bracket markup you can use for the Artima Forums. But of course the bloggers wanted more. They wanted to be able to do lists, and images, and tables, and embedded hyperlinks. And I felt all those were very reasonable requests. So the original bloggers and I had a rather long discussion on our mailing list of what the syntax should look like. But it frankly it quickly started looking very ugly. Eventually, Guido van Rossum suggested that whatever I decide, it should either be a standard or very simple. He hinted that our syntax was quickly leaving "simple" behind, and he was right. That's when I decided to just make it HTML to start with, because that's a standard. The other contender was reStructured Text, which is popular in the Python community. I do want eventually to allow bloggers to have the choice of typing their posts in either HTML or reST, but as of now its HTML.
It really came down to a question of trust. I was ending up needing to do a lot of work to create a safer blog input format than HTML, and it was getting ugly to look at and complicated to learn. And I just decided I didn't need that degree of safety, that I trust the bloggers. If a blogger comes along and abuses that freedom, I'll remove the post. And if they continue to be malicious in subsequent posts, I can remove their blog. That approach has worked fine at Artima.
The funny thing about JavaScript is that not only was concerned about it being abused, I also couldn't think of any reasonable need to put JavaScript in a weblog post. But Johan Peeters found a use for it, as an illustration in a blog post about this issue of how to let people post content to a website. It is the very first pop-up that has ever been at Artima, and it is a good use for JavaScript that I never imagined. It reminded me of this week's interview with Bjarne Stroustrup, when he said, "When you design in terms of lists of features or lists of alternatives, you never get the design quite right. There always turns out to be just one more case, or one less." Basically, I didn't support only the list of features I imagined bloggers would need -- paragraphs, bold, italics, images, hyperlinks, and so on -- I just said use HTML however you want to use it. And that allowed Johan to use his blog in a way I hadn't imagined.
Now on the other hand, I think typing in HTML is a pain. What I think would really be nice is a nice what you see is what you get tool that bloggers could use to compose their posts. I would actually like to write such a tool as well, but not for safety concerns so they can't type in nasty attack scripts. I would like to do it to make posting to an Artima weblog an easier and more pleasant user experience.
|
|