1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15:
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17:
18: if (function_exists('conPhp54Check') == false) {
19:
20: function conPhp54Check() {
21: if (!defined('CON_PHP54')) {
22: define('CON_PHP54', version_compare(PHP_VERSION, '5.4.0', '<') ? 0 : 1);
23: }
24:
25: return CON_PHP54;
26: }
27:
28: }
29:
30: if (function_exists('conHtmlSpecialChars') == false) {
31:
32: function conHtmlSpecialChars($value, $flags = '', $encoding = '') {
33: $isPhp54 = conPhp54Check();
34:
35: if ($encoding == '') {
36: $encoding = cRegistry::getEncoding();
37: }
38:
39:
40: if (empty($encoding)) {
41: $encoding = null;
42: }
43:
44: if ($isPhp54 == 1) {
45: $flags = ($flags == '') ? ENT_COMPAT | ENT_HTML401 : $flags;
46: $encoding = ($encoding == '') ? 'UTF-8' : $encoding;
47: } else {
48: $flags = ($flags == '') ? ENT_COMPAT : $flags;
49: }
50:
51: return htmlspecialchars($value, $flags, $encoding);
52: }
53:
54: }
55:
56: if (function_exists('conHtmlEntityDecode') == false) {
57:
58: function conHtmlEntityDecode($value, $flags = '', $encoding = '') {
59: $isPhp54 = conPhp54Check();
60:
61: if ($encoding == '') {
62: $encoding = cRegistry::getEncoding();
63: }
64:
65: if ($isPhp54 == 1) {
66: $flags = ($flags == '') ? ENT_COMPAT | ENT_HTML401 : $flags;
67: $encoding = ($encoding == '') ? 'UTF-8' : $encoding;
68: } else {
69: $flags = ($flags == '') ? ENT_COMPAT : $flags;
70: }
71:
72: return html_entity_decode($value, $flags, $encoding);
73: }
74:
75: }
76:
77: if (function_exists('conHtmlentities') == false) {
78:
79: function conHtmlentities($value, $flags = '', $encoding = '') {
80: $isPhp54 = conPhp54Check();
81:
82: if ($encoding == '') {
83: $encoding = cRegistry::getEncoding();
84: }
85:
86: if ($isPhp54 == 1) {
87: $flags = ($flags == '') ? ENT_COMPAT | ENT_HTML401 : $flags;
88: $encoding = ($encoding == '') ? 'UTF-8' : $encoding;
89: } else {
90: $flags = ($flags == '') ? ENT_COMPAT : $flags;
91: }
92:
93: return htmlentities($value, $flags, $encoding);
94: }
95:
96: }
97:
98: if (function_exists('conGetHtmlTranslationTable') == false) {
99:
100: function conGetHtmlTranslationTable($table = '', $flags = '') {
101: $isPhp54 = conPhp54Check();
102:
103: if ($isPhp54 == 1) {
104: $table = ($table == '') ? HTML_SPECIALCHARS : $table;
105: $flags = ($flags == '') ? ENT_COMPAT | ENT_HTML401 : $flags;
106: } else {
107: $flags = ($flags == '') ? ENT_COMPAT : $flags;
108: }
109:
110: return get_html_translation_table($table, $flags);
111: }
112:
113: }
114: ?>