May 11, 2003

Sanitize: Cleaning Up Incoming Data

2.63にアップデートした辺りからいままでに投稿されたコメントから埋め込まれた画像が消えてしまっていたり、新しく投稿するコメントに画像を埋め込めなくなったり(PreviewやPostを押すとimgタグが消えてしまう)などの問題が起きていたけれど、なんとか原因を突き止めて問題を解決することができたです。

お世話になったのは、こちらの方たち:
Ken & Sarah :: Our Story :: Another Self Deprecating Title
Movable Type User Manual: SANITIZE: CLEANING UP INCOMING DATA

原因は、MT編集画面のBLOG CONFIG(日本語化パッチを充てている場合では「BLOGの設定」)で以下のような設定の部分

Specifies the list of HTML tags allowed by default when cleaning an HTML string (a comment, for example).

ここには設定として
Use defaults:
Use my settings:
のどちらかをボタンで選択できるようになっているけど、ここがDefaultだとHTMLファイルが生成される時にimgタグがクリーンアップされてしまう模様。
理由は、HTMLタグを悪質に利用することで、Cookieを読まれたり、サーバー内のプライベートファイルを読まれたりすることを防ぐためで、defalutでは以下のようになタグのみコメントとして許可している。
 [a href, b, br, p, strong, em, ul, li, blockquote]
そこで次のようにストリングを変更して、Use my settings:のほうに入れてSaveして、サイトをRebuildしてみたところ、コメントに画像を埋め込むことが可能となりました。
 [font, span class, div class, a href, b, i, p, u, blockquote, img/, * src style align width height border] (attributeの指定(width, border, etc.)は、[,]の後に[*]で指定する)

ま、あんまりたいしたことしなくて元に戻ったのはいいとしても、いきなりだしわけわかんなかったよ。
とりあえず、めでたしめでたしということで、これからは思う存分画像入りコメントしてくださいま

Posted by @sushi at May 11, 2003 01:59 PM | TrackBack
Post a comment
<a href="URL" target="_blank">TEXT</a>
『すぐに使えるタグ一覧』









Remember personal info?






Comments

Want to order soma online ? We make it easy for you to order FDA approved muscle relaxant
Looking to lose weight and do it discreetly? Online phentermine ordering is the simplest way.
We offer the best deals and make it easy and convenient to buy in just a few simple steps.
Just visit http://www.online-soma-here.com

Posted by: order soma online at November 27, 2004 05:19 AM

There can be no other truth to take off from than this: I think, therefore, I exist. There we have the absolute truth of consciousness becoming aware of itself.

Posted by: online poker at October 20, 2004 02:19 PM

Metaphysics is the finding of bad reasons for what we believe upon instinct, but to find these reasons is no less an instinct.

Posted by: penis enlargement products at October 20, 2004 02:03 AM

In the consciousness of the truth he has perceived, man now sees everywhere only the awfulness or the absurdity of existence... and loathing seizes him.

Posted by: online casino at October 20, 2004 02:03 AM

If a little knowledge is dangerous, where is a man who has so much as to be out of danger?

Posted by: penis enlargement at October 20, 2004 02:03 AM

おつかれでした

Posted by: mpm at May 12, 2003 08:03 AM

domodomo
うん、サイズも直しといたよ

Posted by: (^▽^) at May 11, 2003 04:37 PM

SUSHIさんほんとうにありがとう
サイズもなおってるん

Posted by: nisico at May 11, 2003 03:59 PM

ちなみに、以前にPOSTしたコメント内にある画像のサイズ指定はなくなってしまっている模様。
オリジナルのサイズで表示されています。たぶん

Posted by: SUSHI CO. at May 11, 2003 02:06 PM