php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59513 Max number of replaces per tag
Submitted: 2010-11-17 16:22 UTC Modified: 2017-04-01 19:32 UTC
From: felixjet at gmail dot com Assigned:
Status: Wont fix Package: bbcode (PECL)
PHP Version: Irrelevant OS: Gentoo
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: felixjet at gmail dot com
New email:
PHP Version: OS:

 

 [2010-11-17 16:22 UTC] felixjet at gmail dot com
Description:
------------
Would be nice to have something like:

'img'=>array('type'=>BBCODE_TYPE_NOARG, 'open_tag'=>'<img 
src="', 'close_tag'=>'" />', 'max'=>5)

So the first 5 [img] tags are replaced, while the others 
remain as plain text.

This could be done via own script (and probably should) but 
would be nice to have such function.

Reproduce code:
---------------
[img] x 8

Expected result:
----------------
<img> x 5

[img] x 3

Actual result:
--------------
[img] x 8

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-25 11:10 UTC] xdecock at gmail dot com
Can you please try the current svn trunk?

tried to implement it, 

might have some shortcommings (see test n?29) with nesting, in fact limitation goes inside out the bbcode parsing tree, i'll check how to do this in natural order.
 [2017-04-01 19:32 UTC] tpunt@php.net
-Status: Open +Status: Wont fix
 [2017-04-01 19:32 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-2025 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 01:01:27 2025 UTC