MyBB Community Forums

Full Version: mycode_parse_img_callback1 issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
As I cannot login to redmine I post my issue here:

If you put two images in one line (using mycode) the mycode_parse_img_callback1 function adds a newline to the output, resulting in a <br> tag in the html code.

E.g.: (no line break between the img tags!)
[img]http://www.opt-community.de/Forum/images/cc/avatare/xavatar_mnt.png.pagespeed.ic.9QWXjXAwoS.png[/img][img]http://www.opt-community.de/Forum/images/cc/avatare/xavatar_mnt.png.pagespeed.ic.9QWXjXAwoS.png[/img]

[Image: xavatar_mnt.png.pagespeed.ic.9QWXjXAwoS.png][Image: xavatar_mnt.png.pagespeed.ic.9QWXjXAwoS.png]

Only the mycode_parse_img_callback1 function adds the newline, the other versions don't do that.

My quick fix, not tested that much yet:

        function mycode_parse_img_callback1($matches)
        {
                #return $this->mycode_parse_img($matches[2])."\n";
                return $this->mycode_parse_img($matches[2]);
        }

A user land workaround would be to force one of the other callback functions like this:

[img align=xyz]http://www.opt-community.de/Forum/images/cc/avatare/xavatar_mnt.png.pagespeed.ic.9QWXjXAwoS.png[/img][img]http://www.opt-community.de/Forum/images/cc/avatare/xavatar_mnt.png.pagespeed.ic.9QWXjXAwoS.png[/img]

[img align=lef]http://www.opt-community.de/Forum/images/cc/avatare/xavatar_mnt.png.pagespeed.ic.9QWXjXAwoS.png[/img][Image: xavatar_mnt.png.pagespeed.ic.9QWXjXAwoS.png]
This has already been fixed in our development repository. Wink I think there are already some threads and/or tickets about it...
I'd searched for it but I might had been to specific searching for the function name only Wink
But at least I would expect a match in the redmine issues...

Anyways, great to hear that it is already fixed for the next release Big Grin