php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58112 Multiple arguments in BBCodes
Submitted: 2008-03-21 20:02 UTC Modified: 2017-04-01 19:29 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: hubert dot roksor at gmail dot com Assigned:
Status: Wont fix Package: bbcode (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-03-21 20:02 UTC] hubert dot roksor at gmail dot com
Description:
------------
It would be really nice if it was possible to specify multiple arguments for a BBCode. For example, we could use something like
[url href="http://example.com" title="Example page"]...text...[/url]

The implementation should allow arguments to be specified in any order. The user would need to indicate the name of the default argument. For instance, if the name of the default argument is "href", those should be identical:
[url="http://example.com"]...[/url]
[url href="http://example.com"]...[/url]

Thanks for reading ;)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-22 05:48 UTC] xdecock at gmail dot com
What will you see as replacement syntax?
It would also be usefull to put a list of argument and define the default argument...

What about a 

'url' => array(

replacement => 
   '<a {href="{title_val%html_quote}"} {title="{title_val%html_quote}"}>{content}</a>',

validation_callback =>
   array('href'=>array('Validator','url')),
arguments=>
   array(
      'href'=>
      array(
        'default_val'=>'{content}',
        'validation'=>array('Validator','url'),
        'forced'=>true
      )
      'title',
      'default'=>'href'
    )
),


If you have a better Idea for declaration, i'm listening, because the current syntax is already quite complex. and my current idea for your suggestion make it even more complex.

But it must be done only one time :)
 [2008-03-22 05:50 UTC] xdecock at gmail dot com
Oups, done an error on the replacement syntax:

here is the correction:

'replacement' => 
   '<a {href="{href_val%html_quote}"}
{title="{title_val%html_quote}"}>{content}</a>',
 [2008-11-20 12:56 UTC] martinrhill2000 at yahoo dot co dot uk
I would also like to show my utmost support for this feature.

It would be great if a "BBCODE_TYPE_MULTIARG" flag would allow multiple arguments without them needing to be predefined. The arguments could be passed to callback functions as an array similar to call_user_func_array().
 [2009-08-31 07:27 UTC] miksir at maker dot ru
I'm starting development of multi argument, but need testers. Already rewrited some part of code - test passed ok, but need real testing (better under high load), because i'm not very familiar with c =)
 [2017-04-01 19:29 UTC] tpunt@php.net
-Status: Open +Status: Wont fix
 [2017-04-01 19:29 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: Wed Jul 17 04:01:25 2019 UTC