|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58649 one-per-level unexpected behavior
Submitted: 2009-04-26 02:03 UTC Modified: 2017-04-01 19:30 UTC
Avg. Score:2.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: Assigned:
Status: Wont fix Package: bbcode (PECL)
PHP Version: 5.2.9 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2009-04-26 02:03 UTC]
When 2 elements with flag BBCODE_FLAGS_ONE_OPEN_PER_LEVEL and type BBCODE_TYPE_SINGLE are separated by a newline, the extension eats the newline.

Reproduce code:

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-26 02:08 UTC] phpbugs at delinked dot net
In case it's of any importance, the email should be No idea how it ended up being
 [2009-04-26 03:47 UTC] xdecock at gmail dot com
I'll check where the EOL is taken, it's quite strange, however, if i remember correctly,

the EOL should be passed to you in the $content param.

The FLAGS_ONE_PER_LEVEL is a kind of "avoid user stupidity" hack, and it emulates a thing like this:

So i think it's more a documentation problem

Let me know.

the main goal of this work was to be able to handle the [*] tag without the closing tag in [list] elements
 [2009-04-26 04:03 UTC] phpbugs at delinked dot net
If one per level and type single is set, shouldn't there be absolutely nothing in $content, since it's not possible for content to be encapsulated?
 [2009-04-26 08:17 UTC] xdecock at gmail dot com
I'll check if _SINGLE is correctly implemented, however, TYPE_SINGLE emulate the close tag just after the open tag, so it is redundant with one per level, as it does not create a new level in the parse tree.

I'll check this and give you more info.
 [2009-04-26 13:17 UTC] phpbugs at delinked dot net
When type single is set, and one-per-level is not, everything after the closing ']' for the single element is eaten, unless an accompanying [/x] element is found.

It seems to be processing inside-out, as if the 3 test elements were [test][test][test][/test][/test][/test], in a way normally expected with non-type-single elements and auto close enabled.
 [2017-04-01 19:30 UTC]
-Status: Open +Status: Wont fix
 [2017-04-01 19:30 UTC]
Due to this extension not seeing any activity since 2010, this issue will not be fixed. We are therefore closing this now.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jul 25 15:01:23 2021 UTC