WP Document Revisions
[resolved] Documents have WordPress HTML appended to them (4 posts)

  1. Lynxy
    Posted 4 years ago #

    Ben Balter, thank you for the wonderful plugin! It is great, save one flaw: when downloading a document, the plugin returns control over to WordPress after outputting the file. This results in the full HTML data of the site being appended to the file! While it does not affect any of the browsers I've tested, I have had complaints from clients showing a bunch of binary data within a page.

    I have a fix for this though! I have it applied on my client's site, and hope you will incorporate it into future updates. The fix entails changing return; to exit; at the end of the method serve_file() in wp-document-revisions.php. Simple enough!

    Thank you


  2. Ben Balter
    Plugin Author

    Posted 4 years ago #

    Sorry for the trouble there. That should be a relatively, recent problem as I know that code was changed to make automated testing easier.

    I have to test it, but I suspect that moving the serve_file filter from single_template to template_include should fix the problem.

    Although template single would in theory be a bit more efficient, depending on the set up, I realize now it could in theory trip one of the other conditions in wp-includes/template-loader.php.

    Exiting isn't explicitly necessary, as template-loader should be the last file executed.

    I've opened up a bug ticket and hope to follow up with a fix.

  3. Ben Balter
    Plugin Author

    Posted 4 years ago #

    Could I trouble you to give the development version (zip) a try? I believe the issue should be resolved.

  4. Ben Balter
    Plugin Author

    Posted 4 years ago #

    Marking the post as resolved (development version) and look for a stable release soon.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Document Revisions
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic