I've just encountered this problem. That If i set in the edit atom properties a link that has more than one GET parameters in it, then the link and the options therefore will contain the & sign.
Example:
<div class="dnd-widget-wrapper context-custom_representation type-image"><div class="dnd-atom-rendered">[scald=1227:custom_representation {"link":"http://example.com?ua=1&ua=1"}]</div></div>
Now when in mee_filter_process it calls
$fragment->appendXML($html);
Then that will return with FALSE, cause the & is not valid in xml to be standing alone.
And then the node will be replaced with an empty fragment. Basically the image will not appear.
One possible solution is to escape the string with php before appending as XML.
Maybe there are other ways to append the html?
Comment | File | Size | Author |
---|---|---|---|
#4 | widget-filter-fails-with-amp-2472223-4.patch | 1.72 KB | gifad |
#1 | widget-filter-fails-with-amp-2472223-1.patch | 709 bytes | nagy.balint |
Comments
Comment #1
nagy.balint CreditAttribution: nagy.balint commentedThis patch will likely fix the problem.
According to http://stackoverflow.com/questions/4400980/how-to-insert-html-to-php-dom...
The solution by Gordon.
Even with that solution the warnings had to be disabled with
libxml_use_internal_errors(true);
, as that only warns that the loaded snippet is not fully xml valid, but that is not a big deal for us, since we know that it is not.Comment #2
gifad CreditAttribution: gifad commentedAnother (safer ?) solution is to encodeURIComponent the options...
Comment #3
gifad CreditAttribution: gifad commentedSame as #2, with less intrusive, and more consistent encoding/decoding (limited to url link of scald_image)
Comment #4
gifad CreditAttribution: gifad commentedDon't decode empty (undefined) value...
Comment #6
nagy.balint CreditAttribution: nagy.balint commentedThanks, Committed.
This is however not a backward compatible fix, but i think this is the proper way to store the url actually. Maybe this will fix also the " Convert URLs into links" issue where the link in the options was converted into a link breaking the markup?
And since its very easy to change on old code (just need an urldecode call) I think it will be enough to put this into the release notes, maybe we can create a change note as well.