Changeset 852 for trunk/Modules/Forum


Ignore:
Timestamp:
Jan 17, 2016, 10:25:29 PM (9 years ago)
Author:
chronos
Message:
  • Fixed: HTML entities need to be converted before BB code is applied as BB parser itself produce HTML code.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Forum/Forum.php

    r851 r852  
    5757        '<td><a href="'.$this->System->Link('/forum/?Thread='.$DbRow['Thread']).'">'.HumanDate($DbRow['Date']).'</a></td>'.
    5858        '<td><a href="'.$this->System->Link('/user/?user='.$DbRow['UserId']).'">'.$DbRow['UserName'].'</a></td>'.
    59         '<td>'.htmlspecialchars($Parser->qparse($DbRow['Text'])).'</td>'.
     59        '<td>'.$Parser->qparse(htmlspecialchars($DbRow['Text'])).'</td>'.
    6060        '</tr>';
    6161    }
     
    152152      $Output .= '<div><a href="'.$this->System->Link('/forum/?Thread='.$Line['Thread']).'">'.
    153153      htmlspecialchars($Line['ThreadName']).'</a><br /><strong>'.$Line['UserName'].
    154       '</strong> ('.HumanDate($Line['Date']).'): '.htmlspecialchars($parser->qparse($Line['Text'])).'</div> ';
     154      '</strong> ('.HumanDate($Line['Date']).'): '.$parser->qparse(htmlspecialchars($Line['Text'])).'</div> ';
    155155    $Output .= '</div>'.$PageList['Output'];
    156156    return($Output);
     
    181181
    182182    $parser = new HTML_BBCodeParser2(array('filters' => array('Basic','Extended','Images','Links','Lists','Email')));
    183   //  echo $parser->qparse('[youtube]http://www.youtube.com/watch?v=hwgO6p2Jh-A[/youtube][img]http://www.bbcode.org/images/lubeck_small.jpg[/img]normal [i][b]bold[/b][/i] [img]http://imageshack.com/a/img203/7462/6ctg.jpg[/img]  and normal again');
    184183
    185184    if(array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search'];
     
    212211      $Output .= '<div><span style="float:right;">'.$edit.' ('.HumanDate($Line['Date']).
    213212        ')</span><strong>'.$Line['UserName'].'</strong>: '.str_replace("\n", '<br />',
    214         htmlspecialchars($parser->qparse($Line['Text']))).'  </div> ';
     213        $parser->qparse(htmlspecialchars($Line['Text']))).'  </div> ';
    215214    }
    216215    $Output .= '</div>'.$PageList['Output'];
     
    321320        'Title' => htmlspecialchars($DbRow['ThreadText']).' - '.$DbRow['UserName'].': ',
    322321        'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/forum/?Thread='.$DbRow['Thread']),
    323         'Description' => htmlspecialchars($parser->qparse($DbRow['Text'])),
     322        'Description' => $parser->qparse(htmlspecialchars($DbRow['Text'])),
    324323        'Time' => $DbRow['UnixDate'],
    325324      );
Note: See TracChangeset for help on using the changeset viewer.