$Date: 2006-03-06 14:58:13 +0000 (Mon, 06 Mar 2006) $
| > $Revision: 161 $
| > $Author: bfarber $
+---------------------------------------------------------------------------
|
| > BB Code NEWER Module
| > Module written by Matt Mecham
| > Date started: Wednesday 9th March 2005 11:31
|
+--------------------------------------------------------------------------
*/
/**
* BBCode Parsing: Core class
*
* This child class contains all methods
* specific to the new parsing methods
*
* @package InvisionPowerBoard
* @subpackage BBCodeParser
* @author Matt Mecham
* @version 2.1
* @since 2.1.0
*/
/**
*
*/
/**
* BBCode Parsing: Core class
*
* This child class contains all methods
* specific to the new parsing methods
*
* @package InvisionPowerBoard
* @subpackage BBCodeParser
* @author Matt Mecham
* @version 2.1
* @since 2.1.0
*/
class class_bbcode extends class_bbcode_core
{
/*-------------------------------------------------------------------------*/
// CONSTRUCTOR
/*-------------------------------------------------------------------------*/
function class_bbcode( )
{
}
/*-------------------------------------------------------------------------*/
// Manage the raw text before inserting into the DB
/*-------------------------------------------------------------------------*/
/**
* Manage the raw text before inserting into the DB
*
* @param string Raw text
* @return string Converted text
*/
function pre_db_parse( $txt="" )
{
//-----------------------------------------
// Reset
//-----------------------------------------
$this->quote_open = 0;
$this->quote_closed = 0;
$this->quote_error = 0;
$this->error = '';
$this->image_count = 0;
$this->emoticon_count = 0;
//-----------------------------------------
// Remove session id's from any post
//-----------------------------------------
$txt = preg_replace( "#(\?|&|;|&)s=([0-9a-zA-Z]){32}(&|;|&|$)?#e", "\$this->regex_bash_session('\\1', '\\3')", $txt );
//-----------------------------------------
// convert
to \n
//-----------------------------------------
if ( ! $this->parse_nl2br )
{
$txt = str_replace( "\n", "", $txt );
}
$txt = preg_replace( "/
|
/", "\n", $txt );
# XSS Clean
/*if( $this->strip_hex_entity )
{
while( preg_match( "/[&|&\;]#x(\w+?);/i", $txt ) )
{
$txt = preg_replace( "/[&|&\;]#x(\w+?);/ies" , "\$this->regex_bash_hex( '\\1' )" , $txt );
}
$txt = preg_replace( "#&(?!\;)#", "", $txt );
}*/
$txt = preg_replace( "#javascript\:#is" , "java script:", $txt );
$txt = preg_replace( "#vb(.+?)?script\:#is", "vb script:" , $txt );
$txt = str_replace( "`" , "`" , $txt );
$txt = preg_replace( "#moz\-binding:#is" , "moz binding:", $txt );
$txt = str_replace( "