Skip to content

Commit

Permalink
Merge pull request #2310 from HDInnovations/6.x.x
Browse files Browse the repository at this point in the history
(Release) v6.3.0
  • Loading branch information
HDVinnie authored Jul 19, 2022
2 parents a5cd46c + 31b8db2 commit 683cc04
Show file tree
Hide file tree
Showing 37 changed files with 1,517 additions and 1,866 deletions.
17 changes: 15 additions & 2 deletions app/Helpers/Bbcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,21 @@ public function parse($source): string
// Character index
$index = 0;

// Loop until there are no more occurrences of '['
while ($index < \strlen($source) && ($index = \stripos($source, '[', $index)) !== false) {
// Don't loop more than the length of the source
while ($index < \strlen($source)) {
// Get the next occurrence of `[`
$index = \stripos($source, '[', $index);

// Break if there are no more occurrences of `[`
if ($index === false) {
break;
}

// Break if `[` is the last character of the source
if ($index + 1 >= \strlen($source)) {
break;
}

// Is the potential tag opening or closing?
if ($source[$index + 1] === '/' && ! empty($openedElements)) {
$name = \array_pop($openedElements);
Expand Down
Loading

0 comments on commit 683cc04

Please sign in to comment.