本帖最後由 雪落無聲 於 2012-12-19 12:47 編輯 9 H% X) ]7 e, E' j: r
$ t% H3 i7 S6 B9 IPHP的HTML內容過濾腳本 htmLawed
% Z) }1 {* T) x2 T- R y" hhtmLawed 可限制某些標籤、屬性以及URL協議。% v3 |" N3 @% v4 h
4 {+ x# R7 \1 u3 s( hmake HTML markup in text secure and standard-compliant
6 g7 A2 U, b3 ?; R% `6 zprocess text for use in HTML, XHTML or XML documents: G W- [' s s0 G
restrict HTML elements, attributes or URL protocols using black- or white-lists: A# s" k6 l+ R( A
balance tags, check element nesting, transform deprecated attributes and tags, make relative URLs absolute, etc.
8 D o# x! O* Q: lfast, highly customizable, well-documented
6 E5 q4 P8 @( ksingle, 47 kb file
, N$ a3 f8 T1 C. nsimple HTML Tidy alternative5 n% g( V. ] V: P+ Q. K" ]. S
free and licensed under LGPL/ d, S$ e+ d. Q7 W% n6 b1 A% V% s9 _
use to filter, secure & sanitize HTML in blog comments or forum posts, generate XML-compatible feed items from web-page excerpts, convert HTML to XHTML, pretty-print HTML, scrape web-pages, reduce spam, remove XSS code, etc.
2 c( V$ U# L! D# ]& O+ V
. q6 \' _; X6 b+ {7 z7 x5 J你可以用這段腳本解決問題, |