diff options
Diffstat (limited to 'code/util.inc.php')
-rw-r--r-- | code/util.inc.php | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/code/util.inc.php b/code/util.inc.php index 724f8bd..194102f 100644 --- a/code/util.inc.php +++ b/code/util.inc.php @@ -1,27 +1,23 @@ <?PHP - if(!defined('UTIL_INC')) { - define('UTIL_INC', 1); + function Subst($string, $subst = array()) { + $tr['$$'] = '$'; - function Subst($string, $subst = array()) { - $tr['$$'] = '$'; - - foreach($subst as $key => $value) - $tr['$' . $key] = $value; - - krsort($tr); - - return strtr($string, $tr); - } + foreach($subst as $key => $value) + $tr['$' . $key] = $value; - if(get_magic_quotes_gpc()) { - function Unquote($string) { - return stripslashes($string); - } - } - else { - function Unquote($string) { - return $string; - } - } + krsort($tr); + + return strtr($string, $tr); + } + + if(get_magic_quotes_gpc()) { + function Unquote($string) { + return stripslashes($string); + } + } + else { + function Unquote($string) { + return $string; + } } ?> |