Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F391336
shared.escape_special_chars.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
780 B
Subscribers
None
shared.escape_special_chars.php
View Options
<?php
/**
* Smarty shared plugin
* @package Smarty
* @subpackage PluginsShared
*/
/**
* escape_special_chars common function
*
* Function: smarty_function_escape_special_chars<br>
* Purpose: used by other smarty functions to escape
* special chars except for already escaped ones
* @author Monte Ohrt <monte at ohrt dot com>
* @param string
* @return string
*/
function
smarty_function_escape_special_chars
(
$string
)
{
if
(!
is_array
(
$string
))
{
$string
=
preg_replace
(
'!&(#?
\w
+);!'
,
'%%%SMARTY_START%%%
\\
1%%%SMARTY_END%%%'
,
$string
);
$string
=
htmlspecialchars
(
$string
);
$string
=
str_replace
(
array
(
'%%%SMARTY_START%%%'
,
'%%%SMARTY_END%%%'
),
array
(
'&'
,
';'
),
$string
);
}
return
$string
;
}
/* vim: set expandtab: */
?>
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Feb 22, 20:21 (1 d, 3 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25900
Default Alt Text
shared.escape_special_chars.php (780 B)
Attached To
rZEDHG ZedLegacy
Event Timeline
Log In to Comment