Changeset 6418
- Timestamp:
- 05/19/2017 09:40:51 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.5/includes/admin/parser.php
r4250 r6418 81 81 var $pat_comment2; 82 82 var $pat_wiki; 83 function BBCodeLexer($string, $tagmarker = '[') {83 function __construct($string, $tagmarker = '[') { 84 84 $regex_beginmarkers = Array( '[' => '\[', '<' => '<', '{' => '\{', '(' => '\(' ); 85 85 $regex_endmarkers = Array( '[' => '\]', '<' => '>', '{' => '\}', '(' => '\)' ); … … 114 114 $this->tag = false; 115 115 $this->text = ""; 116 } 117 function BBCodeLexer($string, $tagmarker = '[') { 118 $this->__construct($string, $tagmarker); 116 119 } 117 120 function GuessTextLength() { … … 1147 1150 if (function_exists("html_entity_decode")) 1148 1151 return html_entity_decode($string); 1149 $string = preg_replace ('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string);1150 $string = preg_replace ('~&#([0-9]+);~e', 'chr("\\1")', $string);1152 $string = preg_replace_callback('~&#x([0-9a-f]+);~i', array( $this, '_UnHTMLEncode_chr_callback'), $string); 1153 $string = preg_replace_callback('~&#([0-9]+);~', array($this, '_UnHTMLEncode_chr_hexdec_callback'), $string); 1151 1154 $trans_tbl = get_html_translation_table(HTML_ENTITIES); 1152 1155 $trans_tbl = array_flip($trans_tbl); 1153 1156 return strtr($string, $trans_tbl); 1157 } 1158 function _UnHTMLEncode_chr_callback($match) { 1159 return chr(hexdec($match[1])); 1160 } 1161 function _UnHTMLEncode_chr_hexdec_callback($match) { 1162 return chr(hexdec($match[1])); 1154 1163 } 1155 1164 function Wikify($string) { … … 1384 1393 else $value = @$default_array[$matches[1]]; 1385 1394 if (strlen(@$matches[2])) { 1386 foreach ( split(".", substr($matches[2], 1)) as $index) {1395 foreach (explode(".", substr($matches[2], 1)) as $index) { 1387 1396 if (is_array($value)) 1388 1397 $value = @$value[$index];
Note: See TracChangeset
for help on using the changeset viewer.