1: <?php
2: 3: 4: 5: 6: 7:
8:
9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20:
21: function smarty_modifiercompiler_unescape($params)
22: {
23: if (!isset($params[1])) {
24: $params[1] = 'html';
25: }
26: if (!isset($params[2])) {
27: $params[2] = '\'' . addslashes(Smarty::$_CHARSET) . '\'';
28: } else {
29: $params[2] = "'" . $params[2] . "'";
30: }
31:
32: switch (trim($params[1], '"\'')) {
33: case 'entity':
34: case 'htmlall':
35: if (Smarty::$_MBSTRING) {
36: return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')';
37: }
38:
39: return 'html_entity_decode(' . $params[0] . ', ENT_NOQUOTES, ' . $params[2] . ')';
40:
41: case 'html':
42: return 'htmlspecialchars_decode(' . $params[0] . ', ENT_QUOTES)';
43:
44: case 'url':
45: return 'rawurldecode(' . $params[0] . ')';
46:
47: default:
48: return $params[0];
49: }
50: }
51: