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
This commit is contained in:
Aidan Lister 2004-08-25 13:57:52 +00:00
parent 838a929be5
commit 3634432d89

View file

@ -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 @@ echo strip_tags($text, '<p>');
</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>