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