From 3634432d894acc97fa2ac24f9ef731c1a6b246c2 Mon Sep 17 00:00:00 2001 From: Aidan Lister Date: Wed, 25 Aug 2004 13:57:52 +0000 Subject: [PATCH] Simplied the example Moved the warnings together Noted that comments are always stripped git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@167243 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/strings/functions/strip-tags.xml | 49 +++++++++------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/reference/strings/functions/strip-tags.xml b/reference/strings/functions/strip-tags.xml index 24c5481933..a970ac9758 100644 --- a/reference/strings/functions/strip-tags.xml +++ b/reference/strings/functions/strip-tags.xml @@ -1,5 +1,5 @@ - + @@ -25,7 +25,11 @@ allowable_tags was added in PHP 3.0.13 - and PHP 4.0b3. Since PHP 4.3.0, HTML comments are also stripped. + and PHP 4.0b3. + + + Since PHP 4.3.0, HTML comments are also stripped. This is hardcoded and can + not be changed with allowable_tags. @@ -35,6 +39,15 @@ text/data than expected. + + + This function does not modify any attributes on the tags that you allow + using allowable_tags, including the + style and onmouseover attributes + that a mischievous user may abuse when posting text that will be shown + to other users. + + @@ -42,19 +55,13 @@ Test paragraph.

- -Other text'; - +$text = '

Test paragraph.

Other text'; echo strip_tags($text); +echo "\n"; -echo "\n\n-------\n"; - -// allow

+// Allow

echo strip_tags($text, '

'); ?> - ]]> @@ -62,28 +69,12 @@ echo strip_tags($text, '

'); Test paragraph.

- -Other text +Test paragraph. Other text +

Test paragraph.

Other text ]]>
- - - This function does not modify any attributes on the tags that you allow - using allowable_tags, including the - style and onmouseover attributes - that a mischievous user may abuse when posting text that will be shown - to other users. - - strip_tags has been binary safe since PHP 5.0.0