To reproduce, on vBulletin Connect 5.5.5 create a new post with a hyperlinked image as source:
(I removed the starting brackets in the bbcode above, otherwise it kept getting interpreted...)
Then save the post, and edit it. You will see that in WYSIWYG mode, the image is not linked. When you view the source at this point, you will see that the URL bbcode is missing- only the IMG2 code remains. If you save the post, the hyperlink is lost.
Possible solution: in core/vb/wysiwyghtmlparser.php:
If you patch the file as described above, then refresh and try to edit the post again, you will see that both the URL and the IMG2 tags are still there.
Code:
URL="https://vbulletin.com"]IMG2=JSON]{"data-align":"none","data-size":"full","src":"https:\/\/www.vbulletin.com\/magento\/skin\/frontend\/vbulletin\/default\/images\/logo.gif"}/IMG2]URL]
Then save the post, and edit it. You will see that in WYSIWYG mode, the image is not linked. When you view the source at this point, you will see that the URL bbcode is missing- only the IMG2 code remains. If you save the post, the hyperlink is lost.
Possible solution: in core/vb/wysiwyghtmlparser.php:
Code:
# line 520: if (empty($img_node) AND $child_node->nodeName == 'img') { $img_node = $child_node; } Change this to: if (empty($img_node) AND $child_node->nodeName == 'img') { $img_node = $child_node; $node = $img_node; } # line 527: if (empty($img_node)) Change this to: if (empty($img_node) || empty($node->parentNode))
Comment