php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #64387 Support for a specific tag type
Submitted: 2013-03-08 10:53 UTC Modified: 2017-04-01 19:35 UTC
Votes:2
Avg. Score:3.0 ± 2.0
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: therselman at gmail dot com Assigned:
Status: Wont fix Package: bbcode (PECL)
PHP Version: 5.3Git-2013-03-08 (Git) OS: ALL
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-03-08 10:53 UTC] therselman at gmail dot com
Description:
------------
How do I support the following tag type?

[product=123]

This tag accepts an argument but has NO closing tag! I know this can be 
supported like this:

[product]123[/product]
or
[product=123][/product]

But I'm sure you will agree that it is much more verbose!

I have tried combinations of using: BBCODE_TYPE_SINGLE
with a "param_handling" and/or "content_handling" callback functions! It seems 
that BBCODE_TYPE_SINGLE ignores the callbacks as soon as you add the argument 
and leave out the closing tag, probably because BBCODE_TYPE_SINGLE doesn't 
usually expect additional parameters!

I think the fix should be simple; ie. check if there are additional 
paramenters/arguments in BBCODE_TYPE_SINGLE and run the callbacks!

Test script:
---------------
$bbcodes = array(
	'product' =>  array(
			'type'              =>  BBCODE_TYPE_SINGLE,
			'content_handling'  => 'bbcode_product'
		));

function bbcode_product($content, $argument)
{
	return '[PRODUCT]' . $content . ' : ' . $argument . '[/PRODUCT]';
}

$parser = bbcode_create($bbcodes);

echo bbcode_parse($parser, '[product=123]');


Expected result:
----------------
[PRODUCT]123 : [/PRODUCT]

Actual result:
--------------
[product=123]

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-01 19:35 UTC] tpunt@php.net
-Status: Open +Status: Wont fix
 [2017-04-01 19:35 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-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 03:01:29 2024 UTC