mirror of
https://github.com/e107inc/e107.git
synced 2025-08-07 07:06:30 +02:00
Bbcode test and parser cleanup.
This commit is contained in:
@@ -27,7 +27,7 @@ if (!defined('e107_INIT')) { exit; }
|
||||
class e_bbcode
|
||||
{
|
||||
var $bbList; // Caches the file contents for each bbcode processed
|
||||
var $bbLocation; // Location for each file - 'core' or a plugin name
|
||||
var $bbLocation = array(); // Location for each file - 'core' or a plugin name
|
||||
var $preProcess = FALSE; // Set when processing bbcodes prior to saving
|
||||
var $core_bb = array();
|
||||
var $class = FALSE;
|
||||
@@ -224,7 +224,7 @@ class e_bbcode
|
||||
else
|
||||
{ // Opening code to process
|
||||
// If its a single code, we can process it now. Otherwise just stack the value
|
||||
if (array_key_exists('_'.$bbword,$this->bbLocation))
|
||||
if (array_key_exists('_'.$bbword, $this->bbLocation))
|
||||
{ // Single code to process
|
||||
if (count($code_stack) == 0)
|
||||
{
|
||||
@@ -387,10 +387,23 @@ class e_bbcode
|
||||
* @todo - capturing output deprecated
|
||||
*/
|
||||
ob_start();
|
||||
$bbcode_return = eval($bbcode); //FIXME notice removal
|
||||
try
|
||||
{
|
||||
$bbcode_return = eval($bbcode); //FIXME notice removal
|
||||
}
|
||||
catch (ParseError $e)
|
||||
{
|
||||
$error = $debugFile." -- ".$e->getMessage();
|
||||
}
|
||||
|
||||
$bbcode_output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
if(!empty($error))
|
||||
{
|
||||
trigger_error($error, E_USER_NOTICE);
|
||||
}
|
||||
|
||||
/* added to remove possibility of nested bbcode exploits ... */
|
||||
if(strpos($bbcode_return, "[") !== FALSE)
|
||||
{
|
||||
|
Reference in New Issue
Block a user