Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > b19212d1d821b5016fd913fedcadbd3c > files > 72

mason-1.420.0-1mdv2010.0.noarch.rpm

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML::Mason::Escapes - Functions to escape text for Mason</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>

<body style="background-color: white">


<!-- INDEX BEGIN -->
<div name="index">
<p><A NAME="__index__"></a></p>

<ul>

	<li><A HREF="#name">NAME</a></li>
	<li><A HREF="#description">DESCRIPTION</a></li>
</ul>

<hr name="index" />
</div>
<!-- INDEX END -->

<p>
</p>
<h1><A NAME="name">NAME</a></h1>
<p>HTML::Mason::Escapes - Functions to escape text for Mason</p>
<p>
</p>
<hr />
<h1><A NAME="description">DESCRIPTION</a></h1>
<p>This module contains functions for implementing Mason's <A HREF="Devel.html#escaping_expressions">substitution escaping</a> feature.  These
functions may also be called directly.</p>
<dl>
<dt><strong><A NAME="html_entities_escape" class="item">html_entities_escape</a></strong></dt>

<dd>
<p>This function takes a scalar reference and HTML-escapes it using the
<code>HTML::Entities</code> module.  By default, this module assumes that the
string it is escaping is in ISO-8859-1 (pre Perl 5.8.0) or UTF-8 (Perl
5.8.0 onwards).  If this is not the case for your data, you will want
to override this escape to do the right thing for your encoding.  See
the section on <A HREF="Devel.html#user_defined_escapes">User-defined Escapes in the Developer's Manual</a> for more details on
how to do this.</p>
</dd>
<dt><strong><A NAME="url_escape" class="item">url_escape</a></strong></dt>

<dd>
<p>This takes a scalar reference and replaces any text it contains
matching <code>[^a-zA-Z0-9_.-]</code> with the URL-escaped equivalent, a percent
sign (%) followed by the hexadecimal number of that character.</p>
</dd>
<dt><strong><A NAME="basic_html_escape" class="item">basic_html_escape</a></strong></dt>

<dd>
<p>This function takes a scalar reference and HTML-escapes it, escaping
the following characters: '&amp;', '&gt;', '&lt;', and '&quot;'.</p>
<p>It is provided for those who wish to use it to replace (or supplement)
the existing 'h' escape flag, via the Interpreter's <A HREF="Interp.html#item_set_escape"><code>set_escape()</code> method</a>.</p>
<p>This function is provided in order to allow people to return the HTML
escaping behavior in 1.0x.  However, this behavior presents a
potential security risk of allowing cross-site scripting attacks.
HTML escaping should always be done based on the character set a page
is in.  Merely escaping the four characters mentioned above is not
sufficient.  The quick summary of why is that for some character sets,
characters other than '&lt;' may be interpreted as a &quot;less than&quot; sign,
meaning that just filtering '&lt;' and '&gt;' will not stop all cross-site
scripting attacks.  See
<a href="http://www.megasecurity.org/Info/cross-site_scripting.txt">http://www.megasecurity.org/Info/cross-site_scripting.txt</a> for more
details.</p>
</dd>
</dl>

</body>

</html>