1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
16:
17: if (function_exists('conPhp54Check') == false) {
18:
19: function conPhp54Check() {
20: if (!defined('CON_PHP54')) {
21: define('CON_PHP54', version_compare(PHP_VERSION, '5.4.0', '<')? 0 : 1);
22: }
23:
24: return CON_PHP54;
25: }
26: }
27:
28: if (function_exists('conHtmlSpecialChars') == false) {
29:
30: function conHtmlSpecialChars($value, $flags = '', $encoding = '') {
31: $isPhp54 = conPhp54Check();
32:
33: if ($isPhp54 == 1) {
34: $flags = ($flags == '')? ENT_COMPAT | ENT_HTML401 : $flags;
35: $encoding = ($encoding == '')? 'UTF-8' : $encoding;
36: } else {
37: $flags = ($flags == '')? ENT_COMPAT : $flags;
38: }
39:
40: return htmlspecialchars($value, $flags, $encoding);
41: }
42: }
43:
44: if (function_exists('conHtmlEntityDecode') == false) {
45:
46: function conHtmlEntityDecode($value, $flags = '', $encoding = '') {
47: $isPhp54 = conPhp54Check();
48:
49: if ($isPhp54 == 1) {
50: $flags = ($flags == '')? ENT_COMPAT | ENT_HTML401 : $flags;
51: $encoding = ($encoding == '')? 'UTF-8' : $encoding;
52: } else {
53: $flags = ($flags == '')? ENT_COMPAT : $flags;
54: }
55:
56: return html_entity_decode($value, $flags, $encoding);
57: }
58: }
59:
60: if (function_exists('conHtmlentities') == false) {
61:
62: function conHtmlentities($value, $flags = '', $encoding = '') {
63: $isPhp54 = conPhp54Check();
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 htmlentities($value, $flags, $encoding);
73: }
74: }
75:
76: if (function_exists('conGetHtmlTranslationTable') == false) {
77:
78: function conGetHtmlTranslationTable($table = '', $flags = '') {
79: $isPhp54 = conPhp54Check();
80:
81: if ($isPhp54 == 1) {
82: $table = ($table == '')? HTML_SPECIALCHARS : $table;
83: $flags = ($flags == '')? ENT_COMPAT | ENT_HTML401 : $flags;
84: } else {
85: $flags = ($flags == '')? ENT_COMPAT : $flags;
86: }
87:
88: return get_html_translation_table($table, $flags);
89: }
90: }
91:
92: ?>