php.net |  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
Votes:1
Avg. Score:2.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: wshs@php.net Assigned:
Status: Wont fix Package: bbcode (PECL)
PHP Version: 5.2.9 OS: Linux 2.6.19.7
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-04-26 02:03 UTC] wshs@php.net
Description:
------------
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:
---------------
http://pastebin.com/f1dde4d99

Expected result:
----------------
[test=1]
[test=2]
[test=3]
---
1
2
3

Actual result:
--------------
[test=1]
[test=2]
[test=3]
---
123

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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 phpbugs@delinked.net. No idea how it ended up being @php.net.
 [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:
[test=1]
[/test][test=2]
[/test][test=3]
[/test]

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] tpunt@php.net
-Status: Open +Status: Wont fix
 [2017-04-01 19:30 UTC] tpunt@php.net
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-2019 The PHP Group
All rights reserved.
Last updated: Fri Sep 20 09:01:26 2019 UTC