mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
added htmlall attribute to escape modifier
This commit is contained in:
1
NEWS
1
NEWS
@@ -1,3 +1,4 @@
|
||||
- added htmlall attribute to escape (Monte)
|
||||
- added template_exists() API function. (Andrei)
|
||||
- fixed a problem with using dynamic values for 'file'
|
||||
attribute of {include_php} tag. (Andrei)
|
||||
|
@@ -741,6 +741,7 @@ function _generate_debug_output() {
|
||||
/*
|
||||
* Find out if the resource exists.
|
||||
*/
|
||||
|
||||
$readable = true;
|
||||
if ($resource_type == 'file' && !@is_file($resource_name)) {
|
||||
$readable = false;
|
||||
|
@@ -669,19 +669,20 @@ no title</programlisting>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
This is used to html escape, url escape, escape single quotes on a
|
||||
variable not already escaped, hex escape or hexentity escape. hex
|
||||
and hexentity escape can be used in conjunction to hide "mailto:"
|
||||
links on a page from web spiders (spam collectors) and yet keep
|
||||
them readable and linkable. By default, the variable is html
|
||||
escaped.
|
||||
This is used to html (or htmlall) escape, url escape, escape single
|
||||
quotes on a variable not already escaped, hex escape or hexentity
|
||||
escape. hex and hexentity escape can be used in conjunction to hide
|
||||
"mailto:" links on a page from web spiders (spam collectors) and
|
||||
yet keep them readable and linkable. By default, the variable is
|
||||
html escaped.
|
||||
</para>
|
||||
<example>
|
||||
<title>escape</title>
|
||||
<programlisting>
|
||||
{$articleTitle}
|
||||
{$articleTitle|escape}
|
||||
{$articleTitle|escape:"html"}
|
||||
{$articleTitle|escape:"html"} {* escapes & " ' < > *}
|
||||
{$articleTitle|escape:"htmlall"} {* escapes ALL html entities *}
|
||||
{$articleTitle|escape:"url"}
|
||||
{$articleTitle|escape:"quotes"}
|
||||
<a
|
||||
|
@@ -741,6 +741,7 @@ function _generate_debug_output() {
|
||||
/*
|
||||
* Find out if the resource exists.
|
||||
*/
|
||||
|
||||
$readable = true;
|
||||
if ($resource_type == 'file' && !@is_file($resource_name)) {
|
||||
$readable = false;
|
||||
|
@@ -14,6 +14,9 @@ function smarty_modifier_escape($string, $esc_type = 'html')
|
||||
case 'html':
|
||||
return htmlspecialchars($string, ENT_QUOTES);
|
||||
|
||||
case 'htmlall':
|
||||
return htmlentities($string, ENT_QUOTES);
|
||||
|
||||
case 'url':
|
||||
return urlencode($string);
|
||||
|
||||
|
@@ -14,6 +14,9 @@ function smarty_modifier_escape($string, $esc_type = 'html')
|
||||
case 'html':
|
||||
return htmlspecialchars($string, ENT_QUOTES);
|
||||
|
||||
case 'htmlall':
|
||||
return htmlentities($string, ENT_QUOTES);
|
||||
|
||||
case 'url':
|
||||
return urlencode($string);
|
||||
|
||||
|
Reference in New Issue
Block a user