Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSS feed does not validate because 3rd party plugins insert javascript #615

Closed
mandrasch opened this issue Dec 29, 2014 · 1 comment
Closed

Comments

@mandrasch
Copy link

Hey podlove-dev-team!

The RSS feed of podlove returns the following:
ERR_CONTENT_DECODING_FAILED

After downloading the page via curl I found out that the plugins NextGenGallery (v2) and FooBox FREE (v1.0.3) are causing the problem because they insert javascript code:

<!-- ngg_resource_manager_marker -->    <script type="text/javascript" charset="utf-8">
    /* <![CDATA[ */
    jQuery(document).ready(function($){
        $(function(){
                    $("a[rel=wp_lightbox_fancybox_image]").fancybox({
                        padding         : 10
                    });
                    $("a[rel=wp_lightbox_fancybox_youtube_video]").fancybox({
                        padding     : 10,
                        width       : "80%",
                        height      : "80%",
                        maxWidth    : 640,
                        maxHeight   : 480,
                        autoPlay        : false,
                        helpers : {
                                media : {
                                    youtube : {
                                        params : {
                                            autoplay : 0
                                        }
                                    }
                                }
                        }
                    });
                    $("a[rel=wp_lightbox_fancybox_vimeo_video]").fancybox({
                        padding     : 10,
                        width       : "80%",
                        height      : "80%",
                        maxWidth    : 640,
                        maxHeight   : 480,
                        autoPlay        : false,
                        helpers : {
                                media : {
                                    vimeo : {
                                        params : {
                                            autoplay : 0
                                        }
                                    }
                                }
                        }
                    });
                    $("a[rel=wp_lightbox_fancybox_flash_video]").fancybox({
                        padding     : 10,
                        width       : "80%",
                        height      : "80%",
                        maxWidth    : 640,
                        maxHeight   : 480
                    });
        });
    });
    /* ]]> */
    </script>   <div style="display:none">
    </div>
<script type="text/javascript">/* Run FooBox FREE (v1.0.3) */
(function( FOOBOX, $, undefined ) {
  FOOBOX.o = {wordpress: { enabled: true }, showCount:false, excludes:'.fbx-link,.nofoobox,.nolightbox,a[href*="pinterest.com/pin/create/button/"]', affiliate : { enabled: false }, error: "Could not load the item"};
  FOOBOX.init = function() {
    $(".fbx-link").removeClass("fbx-link");
    $(".gallery, .wp-caption, a:has(img[class*=wp-image-])").foobox(FOOBOX.o);
  };
}( window.FOOBOX = window.FOOBOX || {}, jQuery ));

FooBox.ready(function() {
  //preload the foobox font
  jQuery("body").append("<span style=\"font-family:'foobox'; color:transparent; position:absolute; top:-1000em;\">f</span>");
  FOOBOX.init();

});
</script><?xml version="1.0" encoding="UTF-8"?><rss version="2.0"

I know that this is not really your problem, but the bug was submitted multiple times to the devs of NG Gallery, but there was no fix yet.
https://wordpress.org/support/topic/nextgen-gallery-and-feed-rss

I think that there will be more plugins in future which won't check for rss-feed generation. Because of that maybe you can come up with a solution to strip out javascript which is above the xml tag?

Thanks in advance!

Cheers,
Matthias

@eteubert
Copy link
Member

eteubert commented Jan 2, 2015

This makes me cringe and is, unfortunately, out of my control.
Please take the time and report a new bug to both plugin authors. All they have to do is insert

if (is_feed()) {
  return;
}

before printing the above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants