本帖最後由 雪落無聲 於 2012-12-19 12:47 編輯
, s# a8 Z9 X& e! _" R! S
O" \2 V0 a. x B- _8 U" A: APHP的HTML內容過濾腳本 htmLawed; X0 n* a7 \& S) B* r. i H! v9 [2 L/ Z
htmLawed 可限制某些標籤、屬性以及URL協議。6 A! q0 D7 ?. k6 ?
. F7 f/ S4 W7 p4 A [make HTML markup in text secure and standard-compliant
' `6 A! [8 r. ~) n" {: Fprocess text for use in HTML, XHTML or XML documents( D6 X. S! _ @/ @, \) I
restrict HTML elements, attributes or URL protocols using black- or white-lists
* z9 E8 O- [! Xbalance tags, check element nesting, transform deprecated attributes and tags, make relative URLs absolute, etc.) j6 D, O. P7 [- m: K; Z$ v/ n0 e
fast, highly customizable, well-documented
0 w* g# W$ S$ Bsingle, 47 kb file
5 f) j) K a# l# ~4 xsimple HTML Tidy alternative/ J( f: U$ Y0 D" q7 Y( L( s( d
free and licensed under LGPL
1 c% m3 u' {+ s( r6 G6 `7 L4 Huse 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.
, x9 F, H! u, B$ o' q. h: }) w/ g! C' s$ f( c6 y) p1 r( `2 l
你可以用這段腳本解決問題, |