{"id":2200501,"date":"2011-07-21T18:41:34","date_gmt":"2011-07-21T18:41:34","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/plugin-mudslideshow-malformed-generated-code-problem\/"},"modified":"2016-08-20T01:35:53","modified_gmt":"2016-08-20T01:35:53","slug":"plugin-mudslideshow-malformed-generated-code-problem","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/plugin-mudslideshow-malformed-generated-code-problem\/","title":{"rendered":"[Plugin: MudSlideShow] Malformed generated code problem"},"content":{"rendered":"<p>Hi!<\/p>\n<p>I set up to try your plugin but found a problem with the code generated for galleries in a page. For instance:<\/p>\n<p><code>[mudslide:flickr,0,89687103@N00,72157615386874737]<\/code><\/p>\n<p>I pinpointed the problem to a quote escaping problem on mudslideshow.php function muds_gallery. When assigning the variable <code>$updatelink<\/code> bogus <code>&lt;br \/&gt;<\/code> were being inserted in the javascript for the <code>onclick<\/code> attribute of the generated <code>a<\/code> tag.<\/p>\n<p>The obvious solution was to convert said javascript into a one-liner and replace quotes with the corresponding entity <code>&amp;quot;<\/code>. The result is somewhat less legible, but it works on my server:<\/p>\n<p><code>$updatelink = &quot;&lt;div id=&#039;throbber-msspage$rand&#039; class=&#039;throbber-off&#039;&gt;&lt;a style=&#039;cursor : pointer;&#039; id=&#039;mss-update-$rand&#039; onclick=&#039;var aux = document.getElementById(&amp;quot;throbber-msspage$rand&amp;quot;);aux.setAttribute(&amp;quot;class&amp;quot;, &amp;quot;throbber-on&amp;quot;);aux.setAttribute(&amp;quot;className&amp;quot;, &amp;quot;throbber-on&amp;quot;);muds_update( &amp;quot;gallery&amp;quot;, {$aux[&#039;id&#039;]},&amp;quot;{$aux[&#039;type&#039;]}&amp;quot;, &amp;quot;{$aux[&#039;user&#039;]}&amp;quot;, &amp;quot;{$aux[&#039;gallery&#039;]}&amp;quot;, $first, $last, $conf, $rand );&#039;&gt;&quot;.__(&#039;Update&#039;,&#039;mudslide&#039;).&quot;&lt;\/a&gt;&lt;\/div&gt;&quot;;<\/code> <\/p>\n<p>I have noticed other problems (i.e.: including descriptions in galleries seem to break them, skipping random images), but with this tiny fix I can use your plugin. Thank you for your effort!<\/p>\n","protected":false},"template":"","class_list":["post-2200501","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2200501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2200501\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=2200501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}