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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 06:01:30 2024 UTC