Changeset 3748954 for bbpress/branches/2.6/includes/admin/parser.php
- Timestamp:
- 10/15/2026 04:34:30 PM (2 weeks ago)
- File:
-
- 1 edited
-
bbpress/branches/2.6/includes/admin/parser.php (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bbpress/branches/2.6/includes/admin/parser.php
r2190832 r3748954 137 137 } 138 138 else { 139 switch (ord(substr($t his->text, 0, 1))) {139 switch (ord(substr($text, 0, 1))) { 140 140 case 10: 141 141 case 13: … … 795 795 if ($action == BBCODE_CHECK) 796 796 return strlen($name) > 0; 797 $title = trim(@$params['title']);797 $title = isset($params['title']) ? trim($params['title']) : ''; 798 798 if (strlen($title) <= 0) $title = trim($default); 799 799 return "<a href=\"{$bbcode->wiki_url}$name\" class=\"bbcode_wiki\">" … … 807 807 if (!preg_match("/(?:\\/\\.\\.\\/)|(?:^\\.\\.\\/)|(?:^\\/)/", $content)) { 808 808 $info = @getimagesize("{$bbcode->local_img_dir}/{$content}"); 809 if ( $info[2] == IMAGETYPE_GIF || $info[2] == IMAGETYPE_JPEG || $info[2] == IMAGETYPE_PNG) {809 if (is_array($info) && ($info[2] == IMAGETYPE_GIF || $info[2] == IMAGETYPE_JPEG || $info[2] == IMAGETYPE_PNG)) { 810 810 return "<img src=\"" 811 811 . htmlspecialchars("{$bbcode->local_img_url}/{$content}") . "\" alt=\"" … … 869 869 'square' => 'square', 870 870 ); 871 $default = trim( $default);871 $default = trim((string) $default); 872 872 if ($action == BBCODE_CHECK) { 873 if ( !is_string($default) || strlen($default) == "") return true;873 if ($default === '') return true; 874 874 else if (isset($list_styles[$default])) return true; 875 875 else if (isset($ci_list_styles[strtolower($default)])) return true; 876 876 else return false; 877 877 } 878 if ( !is_string($default) || strlen($default) == "") {878 if ($default === '') { 879 879 $elem = 'ul'; 880 880 $type = ''; 881 881 } 882 else if ($default == '1') {882 else if ($default === '1') { 883 883 $elem = 'ol'; 884 884 $type = ''; … … 1010 1010 var $smileys; 1011 1011 var $smiley_regex; 1012 var $smiley_info; 1012 1013 var $enable_smileys; 1013 1014 var $wiki_url; … … 1020 1021 var $post_trim; 1021 1022 var $debug; 1023 var $lexer; 1024 var $stack; 1022 1025 1023 1026 … … 1035 1038 $this->enable_smileys = true; 1036 1039 $this->smiley_regex = false; 1040 $this->smiley_info = Array(); 1037 1041 $this->smiley_dir = $this->GetDefaultSmileyDir(); 1038 1042 $this->smiley_url = $this->GetDefaultSmileyURL(); … … 1047 1051 $this->start_tags = Array(); 1048 1052 $this->tag_marker = '['; 1049 $this->allow_amp sersand = false;1053 $this->allow_ampersand = false; 1050 1054 $this->current_class = $this->root_class; 1051 1055 $this->debug = false; … … 1283 1287 else { 1284 1288 $info = @getimagesize($this->smiley_dir . '/' . $this->smileys[$token]); 1289 $info = is_array($info) ? $info : Array('', ''); 1285 1290 $this->smiley_info[$token] = $info; 1286 1291 } … … 1567 1572 } 1568 1573 function Internal_CleanupWSByPoppingStack($pattern, &$array) { 1569 if ( strlen($pattern) <= 0) return;1574 if (empty($pattern)) return; 1570 1575 $oldlen = count($array); 1571 1576 foreach (str_split($pattern) as $char) { … … 1592 1597 } 1593 1598 function Internal_CleanupWSByEatingInput($pattern) { 1594 if ( strlen($pattern) <= 0) return;1599 if (empty($pattern)) return; 1595 1600 foreach (str_split($pattern) as $char) { 1596 1601 switch ($char) { … … 1618 1623 } 1619 1624 function Internal_CleanupWSByIteratingPointer($pattern, $pos, $array) { 1620 if ( strlen($pattern) <= 0) return $pos;1625 if (empty($pattern)) return $pos; 1621 1626 foreach (str_split($pattern) as $char) { 1622 1627 switch ($char) { … … 1848 1853 if ($token_type == BBCODE_EOI) { 1849 1854 $this->lexer->RestoreState($state); 1855 array_splice($this->stack, $start); 1856 $this->Internal_ComputeCurrentClass(); 1850 1857 $this->stack[] = Array( 1851 1858 BBCODE_STACK_TOKEN => BBCODE_TEXT, … … 1863 1870 $this->Internal_ComputeCurrentClass(); 1864 1871 $this->Internal_CleanupWSByPoppingStack(@$tag_rule['before_tag'], $this->stack); 1865 $tag_params['_endtag'] = $end_tag _params['_tag'];1872 $tag_params['_endtag'] = $end_tag; 1866 1873 $tag_params['_hasend'] = true; 1867 1874 $output = $this->DoTag(BBCODE_OUTPUT, $tag_name, … … 1966 1973 } 1967 1974 function Parse($string) { 1975 $string = (string) $string; 1968 1976 $this->lexer = new BBCodeLexer($string, $this->tag_marker); 1969 1977 $this->lexer->debug = $this->debug;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)