WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
Blank line at the end of files with ?> (6 posts)

  1. alexphelps3
    Member
    Posted 5 months ago #

    While troubleshooting an XML problem today I discovered that there is a blank line at the end of both sunrise.php and domain_mapping.php after the closing ?> tags.

    Removing these blank lines fixed our XML errors that were showing up all over the place including wp-opml-links.php, RSS feeds, etc.

    Should we follow WP PHP Coding standards and Omit the trailing ?> tags?

    http://make.wordpress.org/core/handbook/coding-standards/php/#remove-trailing-spaces

    http://wordpress.org/plugins/wordpress-mu-domain-mapping/

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 5 months ago #

    If you download a fresh copy of the zip, the blank lines aren't there. Something you were using to edit the files added the blank line on the end.

  3. alexphelps3
    Member
    Posted 5 months ago #

    I downloaded it again just to confirm, and they are there for me when I open the zip file again. I also now see after looking in trunk and they are not there so that is good news but still confusing how I am getting them. I'm using Sublime to open the files, not really sure how the blank line is getting added.

    http://plugins.trac.wordpress.org/browser/wordpress-mu-domain-mapping/trunk/sunrise.php
    http://plugins.trac.wordpress.org/browser/wordpress-mu-domain-mapping/trunk/domain_mapping.php

    I'm not sure, but I would assume that my problem is experienced by most people. There are hundreds of posts about White space problems and the issues they cause.

    Would it be better to remove the closing ?> tags so the problem can't occur and it would follow WP coding standards closer?

    Is there an argument for keeping the closing ?> tags?

  4. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 5 months ago #

    but I would assume that my problem is experienced by most people.

    The download counter shows ~ 208,000 downloads. We get about one thread per year saying there is an extra line at the end.

    Is there an argument for keeping the closing ?> tags?

    There is no problem with you removing them.

  5. alexphelps3
    Member
    Posted 5 months ago #

    My localhost is a pretty standard mac setup, I've downloaded the plugin a few more times now and each time I get the whitespace in the bottom when opening the file - really dont understand how it is happening.

    Sounds like you guys want to keep the closing ?> - just thought it would be better to follow WP coding standards that recommend omitting it.
    Here are some articles out in the community for fixing the problems caused by a whitespace after a closing ?>. Googling a bit, it's pretty easy to find hundreds of articles from people who have broken feeds and can't track them down. We just never thought to look in sunrise.php or domain_mapping.php

    http://wejn.org/stuff/wejnswpwhitespacefix.php.html
    http://www.alex-wells.co.uk/wordpress-rss-feed-white-space-fix/

    The whitespace issue breaks the following things:

    • RSS feeds
    • XML-PRC
    • Anything on the admin that requires Ajax
    • Admin XML response for adding new categories on a post, need to refresh
  6. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 5 months ago #

    Sounds like you guys want to keep the closing ?>

    We're not releasing a new version just to remove them.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.