Changeset 6212
- Timestamp:
- 01/11/2017 08:33:09 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/parser.php
r5909 r6212 89 89 var $pat_comment2; 90 90 var $pat_wiki; 91 function BBCodeLexer($string, $tagmarker = '[') {91 function __construct($string, $tagmarker = '[') { 92 92 $regex_beginmarkers = Array( '[' => '\[', '<' => '<', '{' => '\{', '(' => '\(' ); 93 93 $regex_endmarkers = Array( '[' => '\]', '<' => '>', '{' => '\}', '(' => '\)' ); … … 122 122 $this->tag = false; 123 123 $this->text = ""; 124 } 125 function BBCodeLexer($string, $tagmarker = '[') { 126 $this->__construct($string, $tagmarker); 124 127 } 125 128 function GuessTextLength() { … … 1155 1158 if (function_exists("html_entity_decode")) 1156 1159 return html_entity_decode($string); 1157 $string = preg_replace ('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string);1158 $string = preg_replace ('~&#([0-9]+);~e', 'chr("\\1")', $string);1160 $string = preg_replace_callback('~&#x([0-9a-f]+);~i', array( $this, '_UnHTMLEncode_chr_callback'), $string); 1161 $string = preg_replace_callback('~&#([0-9]+);~', array($this, '_UnHTMLEncode_chr_hexdec_callback'), $string); 1159 1162 $trans_tbl = get_html_translation_table(HTML_ENTITIES); 1160 1163 $trans_tbl = array_flip($trans_tbl); 1161 1164 return strtr($string, $trans_tbl); 1165 } 1166 function _UnHTMLEncode_chr_callback($match) { 1167 return chr(hexdec($match[1])); 1168 } 1169 function _UnHTMLEncode_chr_hexdec_callback($match) { 1170 return chr(hexdec($match[1])); 1162 1171 } 1163 1172 function Wikify($string) { … … 1392 1401 else $value = @$default_array[$matches[1]]; 1393 1402 if (strlen(@$matches[2])) { 1394 foreach ( split(".", substr($matches[2], 1)) as $index) {1403 foreach (explode(".", substr($matches[2], 1)) as $index) { 1395 1404 if (is_array($value)) 1396 1405 $value = @$value[$index];
Note: See TracChangeset
for help on using the changeset viewer.