本帖最後由 雪落無聲 於 2012-12-19 12:47 編輯
& h( Z0 i3 l% x7 F" _# Z7 y# Q2 }- V0 w
PHP的HTML內容過濾腳本 htmLawed7 q V8 h) s8 y$ F [! ^! D
htmLawed 可限制某些標籤、屬性以及URL協議。
& u8 i+ F* z0 z& y7 u# t0 \ ?3 G; Q& M
make HTML markup in text secure and standard-compliant
/ `6 ?7 _3 o7 }/ z% F Jprocess text for use in HTML, XHTML or XML documents# {/ D" N3 h" g1 ?0 ?, E# R
restrict HTML elements, attributes or URL protocols using black- or white-lists1 j3 b$ h5 L# e" n6 i' r, [- a
balance tags, check element nesting, transform deprecated attributes and tags, make relative URLs absolute, etc.
" p$ e/ u2 V" u, E7 d. Bfast, highly customizable, well-documented* F* }5 T9 ?2 G! K1 }
single, 47 kb file
( e* `$ w; n3 vsimple HTML Tidy alternative5 N. [0 H" L& U" T, e
free and licensed under LGPL
4 p. P, w( e- c. Guse 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.0 U$ F+ H- l2 m& L
- n7 J( a- o5 m& ^; g
你可以用這段腳本解決問題, |