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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

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: Wed Dec 02 19:01:24 2020 UTC