Plugin Directory


Ignore:
Timestamp:
10/15/2026 04:34:30 PM (2 weeks ago)
Author:
johnjamesjacoby
Message:

bbPress: deploy 2.6.20 and its Playground preview.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bbpress/branches/2.6/includes/admin/parser.php

    r2190832 r3748954  
    137137}
    138138else {
    139 switch (ord(substr($this->text, 0, 1))) {
     139switch (ord(substr($text, 0, 1))) {
    140140case 10:
    141141case 13:
    … …  
    795795if ($action == BBCODE_CHECK)
    796796return strlen($name) > 0;
    797 $title = trim(@$params['title']);
     797$title = isset($params['title']) ? trim($params['title']) : '';
    798798if (strlen($title) <= 0) $title = trim($default);
    799799return "<a href=\"{$bbcode->wiki_url}$name\" class=\"bbcode_wiki\">"
    … …  
    807807if (!preg_match("/(?:\\/\\.\\.\\/)|(?:^\\.\\.\\/)|(?:^\\/)/", $content)) {
    808808$info = @getimagesize("{$bbcode->local_img_dir}/{$content}");
    809 if ($info[2] == IMAGETYPE_GIF || $info[2] == IMAGETYPE_JPEG || $info[2] == IMAGETYPE_PNG) {
     809if (is_array($info) && ($info[2] == IMAGETYPE_GIF || $info[2] == IMAGETYPE_JPEG || $info[2] == IMAGETYPE_PNG)) {
    810810return "<img src=\""
    811811. htmlspecialchars("{$bbcode->local_img_url}/{$content}") . "\" alt=\""
    … …  
    869869'square' => 'square',
    870870);
    871 $default = trim($default);
     871$default = trim((string) $default);
    872872if ($action == BBCODE_CHECK) {
    873 if (!is_string($default) || strlen($default) == "") return true;
     873if ($default === '') return true;
    874874else if (isset($list_styles[$default])) return true;
    875875else if (isset($ci_list_styles[strtolower($default)])) return true;
    876876else return false;
    877877}
    878 if (!is_string($default) || strlen($default) == "") {
     878if ($default === '') {
    879879$elem = 'ul';
    880880$type = '';
    881881}
    882 else if ($default == '1') {
     882else if ($default === '1') {
    883883$elem = 'ol';
    884884$type = '';
    … …  
    10101010var $smileys;
    10111011var $smiley_regex;
     1012var $smiley_info;
    10121013var $enable_smileys;
    10131014var $wiki_url;
    … …  
    10201021var $post_trim;
    10211022var $debug;
     1023var $lexer;
     1024var $stack;
    10221025
    10231026
    … …  
    10351038        $this->enable_smileys = true;
    10361039        $this->smiley_regex = false;
     1040        $this->smiley_info = Array();
    10371041        $this->smiley_dir = $this->GetDefaultSmileyDir();
    10381042        $this->smiley_url = $this->GetDefaultSmileyURL();
    … …  
    10471051        $this->start_tags = Array();
    10481052        $this->tag_marker = '[';
    1049         $this->allow_ampsersand = false;
     1053        $this->allow_ampersand = false;
    10501054        $this->current_class = $this->root_class;
    10511055        $this->debug = false;
    … …  
    12831287else {
    12841288$info = @getimagesize($this->smiley_dir . '/' . $this->smileys[$token]);
     1289$info = is_array($info) ? $info : Array('', '');
    12851290$this->smiley_info[$token] = $info;
    12861291}
    … …  
    15671572}
    15681573function Internal_CleanupWSByPoppingStack($pattern, &$array) {
    1569 if (strlen($pattern) <= 0) return;
     1574if (empty($pattern)) return;
    15701575$oldlen = count($array);
    15711576foreach (str_split($pattern) as $char) {
    … …  
    15921597}
    15931598function Internal_CleanupWSByEatingInput($pattern) {
    1594 if (strlen($pattern) <= 0) return;
     1599if (empty($pattern)) return;
    15951600foreach (str_split($pattern) as $char) {
    15961601switch ($char) {
    … …  
    16181623}
    16191624function Internal_CleanupWSByIteratingPointer($pattern, $pos, $array) {
    1620 if (strlen($pattern) <= 0) return $pos;
     1625if (empty($pattern)) return $pos;
    16211626foreach (str_split($pattern) as $char) {
    16221627switch ($char) {
    … …  
    18481853if ($token_type == BBCODE_EOI) {
    18491854$this->lexer->RestoreState($state);
     1855array_splice($this->stack, $start);
     1856$this->Internal_ComputeCurrentClass();
    18501857$this->stack[] = Array(
    18511858BBCODE_STACK_TOKEN => BBCODE_TEXT,
    … …  
    18631870$this->Internal_ComputeCurrentClass();
    18641871$this->Internal_CleanupWSByPoppingStack(@$tag_rule['before_tag'], $this->stack);
    1865 $tag_params['_endtag'] = $end_tag_params['_tag'];
     1872$tag_params['_endtag'] = $end_tag;
    18661873$tag_params['_hasend'] = true;
    18671874$output = $this->DoTag(BBCODE_OUTPUT, $tag_name,
    … …  
    19661973}
    19671974function Parse($string) {
     1975$string = (string) $string;
    19681976$this->lexer = new BBCodeLexer($string, $this->tag_marker);
    19691977$this->lexer->debug = $this->debug;
Note: See TracChangeset for help on using the changeset viewer.