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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
48 - 5 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Fri Aug 14 17:01:26 2020 UTC