aidan Wed Aug 25 09:57:52 2004 EDT
Modified files: /phpdoc/en/reference/strings/functions strip-tags.xml Log: Simplied the example Moved the warnings together Noted that comments are always stripped http://cvs.php.net/diff.php/phpdoc/en/reference/strings/functions/strip-tags.xml?r1=1.9&r2=1.10&ty=u Index: phpdoc/en/reference/strings/functions/strip-tags.xml diff -u phpdoc/en/reference/strings/functions/strip-tags.xml:1.9 phpdoc/en/reference/strings/functions/strip-tags.xml:1.10 --- phpdoc/en/reference/strings/functions/strip-tags.xml:1.9 Thu Jul 22 18:51:12 2004 +++ phpdoc/en/reference/strings/functions/strip-tags.xml Wed Aug 25 09:57:52 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> <refentry id="function.strip-tags"> <refnamediv> @@ -25,7 +25,11 @@ <note> <para> <parameter>allowable_tags</parameter> 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. + </para> + <para> + Since PHP 4.3.0, HTML comments are also stripped. This is hardcoded and can + not be changed with <parameter>allowable_tags</parameter>. </para> </note> <warning> @@ -35,6 +39,15 @@ text/data than expected. </para> </warning> + <warning> + <para> + This function does not modify any attributes on the tags that you allow + using <parameter>allowable_tags</parameter>, including the + <literal>style</literal> and <literal>onmouseover</literal> attributes + that a mischievous user may abuse when posting text that will be shown + to other users. + </para> + </warning> </para> <para> <example> @@ -42,19 +55,13 @@ <programlisting role="php"> <![CDATA[ <?php -$text = ' -<p>Test paragraph.</p> -<!-- Comment --> -Other text'; - +$text = '<p>Test paragraph.</p><!-- Comment --> Other text'; echo strip_tags($text); +echo "\n"; -echo "\n\n-------\n"; - -// allow <p> +// Allow <p> echo strip_tags($text, '<p>'); ?> - ]]> </programlisting> <para> @@ -62,28 +69,12 @@ </para> <screen> <![CDATA[ -Test paragraph. - -Other text - -------- - -<p>Test paragraph.</p> - -Other text +Test paragraph. Other text +<p>Test paragraph.</p> Other text ]]> </screen> </example> </para> - <warning> - <para> - This function does not modify any attributes on the tags that you allow - using <parameter>allowable_tags</parameter>, including the - <literal>style</literal> and <literal>onmouseover</literal> attributes - that a mischievous user may abuse when posting text that will be shown - to other users. - </para> - </warning> <para> <function>strip_tags</function> has been binary safe since PHP 5.0.0 </para>