本帖最後由 雪落無聲 於 2012-12-19 12:47 編輯 5 ?- V9 b/ k* K. T5 a8 p: s
1 _0 N5 U3 l& { F1 ]; Q' _
PHP的HTML內容過濾腳本 htmLawed, [: k6 |9 S7 P0 q) X
htmLawed 可限制某些標籤、屬性以及URL協議。$ |$ y7 i! q) X; G+ R8 D
0 `6 {3 Y0 M3 M
make HTML markup in text secure and standard-compliant; F7 b' Q4 _7 ~+ l3 x2 W
process text for use in HTML, XHTML or XML documents1 C f) t3 r0 H! T$ h# u( ~+ y: i
restrict HTML elements, attributes or URL protocols using black- or white-lists
% S( P x" d- m7 _+ O0 K+ w9 xbalance tags, check element nesting, transform deprecated attributes and tags, make relative URLs absolute, etc.
! A" v3 C& O- K. z8 j- Efast, highly customizable, well-documented
+ P7 c: }1 p$ j8 l% O1 }* [% dsingle, 47 kb file( |0 r! W0 j+ X; z, b
simple HTML Tidy alternative7 m5 p t7 o+ h8 g" n" I2 R' X+ a$ J5 G
free and licensed under LGPL
- w& B/ [! \" n1 n5 Kuse 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./ [' z: G0 M; F5 r/ [% a, P
2 V1 l R% r; \* }
你可以用這段腳本解決問題, |