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: if ($isPhp54 == 1) {
40: $flags = ($flags == '') ? ENT_COMPAT | ENT_HTML401 : $flags;
41: $encoding = ($encoding == '') ? 'UTF-8' : $encoding;
42: } else {
43: $flags = ($flags == '') ? ENT_COMPAT : $flags;
44: }
45:
46: return htmlspecialchars($value, $flags, $encoding);
47: }
48:
49: }
50:
51: if (function_exists('conHtmlEntityDecode') == false) {
52:
53: function conHtmlEntityDecode($value, $flags = '', $encoding = '') {
54: $isPhp54 = conPhp54Check();
55:
56: if ($encoding == '') {
57: $encoding = cRegistry::getEncoding();
58: }
59:
60: if ($isPhp54 == 1) {
61: $flags = ($flags == '') ? ENT_COMPAT | ENT_HTML401 : $flags;
62: $encoding = ($encoding == '') ? 'UTF-8' : $encoding;
63: } else {
64: $flags = ($flags == '') ? ENT_COMPAT : $flags;
65: }
66:
67: return html_entity_decode($value, $flags, $encoding);
68: }
69:
70: }
71:
72: if (function_exists('conHtmlentities') == false) {
73:
74: function conHtmlentities($value, $flags = '', $encoding = '') {
75: $isPhp54 = conPhp54Check();
76:
77: if ($encoding == '') {
78: $encoding = cRegistry::getEncoding();
79: }
80:
81: if ($isPhp54 == 1) {
82: $flags = ($flags == '') ? ENT_COMPAT | ENT_HTML401 : $flags;
83: $encoding = ($encoding == '') ? 'UTF-8' : $encoding;
84: } else {
85: $flags = ($flags == '') ? ENT_COMPAT : $flags;
86: }
87:
88: return htmlentities($value, $flags, $encoding);
89: }
90:
91: }
92:
93: if (function_exists('conGetHtmlTranslationTable') == false) {
94:
95: function conGetHtmlTranslationTable($table = '', $flags = '') {
96: $isPhp54 = conPhp54Check();
97:
98: if ($isPhp54 == 1) {
99: $table = ($table == '') ? HTML_SPECIALCHARS : $table;
100: $flags = ($flags == '') ? ENT_COMPAT | ENT_HTML401 : $flags;
101: } else {
102: $flags = ($flags == '') ? ENT_COMPAT : $flags;
103: }
104:
105: return get_html_translation_table($table, $flags);
106: }
107:
108: }
109: ?>