BBCode::Internal_CleanupWSByPoppingStack( $pattern,  $array )

Description

Source

File: bp-forums/admin/parser.php

function Internal_CleanupWSByPoppingStack($pattern, &$array) {
if (strlen($pattern) <= 0) return;
$oldlen = count($array);
foreach (str_split($pattern) as $char) {
switch ($char) {
case 's':
while (count($array) > 0 && $array[count($array)-1][BBCODE_STACK_TOKEN] == BBCODE_WS)
array_pop($array);
break;
case 'n':
if (count($array) > 0 && $array[count($array)-1][BBCODE_STACK_TOKEN] == BBCODE_NL)
array_pop($array);
break;
case 'a':
while (count($array) > 0
&& (($token = $array[count($array)-1][BBCODE_STACK_TOKEN]) == BBCODE_WS
|| $token == BBCODE_NL))
array_pop($array);
break;
}
}
if (count($array) != $oldlen) {
$this->Internal_ComputeCurrentClass();
}
}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.