Projects ⇒ Bugs ⇒ #633: Bbcode button images not swapping correctly ⇒ CPG Dragonfly™ CMS
Bug #633 Bbcode button images not swapping correctly
Project: Dragonfly 9.0.3 -> 9.3 Category: Output Control
Submitted: Monday, September 19, 2005 (16:42:39) Modified: Monday, October 03, 2005 (02:28:48)
Status: Closed Assigned to:
PHP Version: Irrelevant HTTPD Server: Apache 1.3

View/Vote Add Comment

by: Biggles
The BBCode and BBCcode functions in bbcode.js should be updated to only match the last instance when replacing the image name. Otherwise, urls that contain more than one match may not be rewritten correctly. I would suggest replacing lines 56, 60, 71, and 75 with the following:

line 56:
re = new RegExp(type+".(\\w+)$")
img.src = img.src.replace(re, type+"1.$1");

line 60:
re = new RegExp(type+"1.(\\w+)$")
img.src = img.src.replace(re, type+".$1");

line 71:
re = new RegExp(code+".(\\w+)$")
img.src = img.src.replace(re, code+"1.$1");

line 75:
re = new RegExp(code+"1.(\\w+)$")
img.src = img.src.replace(re, code+".$1");

Expected result:

Actual result:
The "bold" button image is becoming
instead of because the website url contains more than one "b.". A demo can be viewed at
by: DJMaze
This bug has been fixed in the CVS.

Snapshots of the sources are packaged every 6 hours; this change
will be in the next snapshot. You can grab the snapshot at the
Downloads section.

Thank you for the report, and for helping us to make CPG-Nuke 9.0.3 -> 9.1 better.
User Info

Welcome Anonymous


Support for DragonflyCMS in a other languages: