WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
[resolved] Undefined index: HTTPS (22 posts)

  1. MattV
    Member
    Posted 2 years ago #

    When working in WordPress debug mode, I see the following warnings:

    Notice: Undefined index: HTTPS in /path/to/wordpress-mu-domain-mapping/domain_mapping.php on line 545

    Notice: Undefined index: HTTPS in /path/to/wordpress-mu-domain-mapping/domain_mapping.php on line 546

    This was dicussed 10 months ago in this post, but the conclusion was not really clear to me. Should I just ignore the warning or change the plugin code?

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Have you checked to see if a new version has been released in the last 10 months? And, if it has, are you using it?

  3. MattV
    Member
    Posted 2 years ago #

    Yes, I´m using the latest version (0.5.4) - downloaded two days ago from WordPress´ Plugin Directory. I´m using this on a fresh WP Multisite install.

    (To avoid any confusion: I´m not the author of the post that was submitted 10 months ago. I found it today looking for a solution. Thought it could be useful to link to it in this post.)

  4. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    The latest is 0.5.4.1 but the repo still shows (and I assume downloads) 0.5.4. I'll have to bump svn.

  5. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    I'll have to get someone to give it a nudge. Putting through a small change didn't trigger an update in the repo.

  6. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Try re-downloading it and see if you still have the warnings. If you hover over the download link it is downloading 0.5.4.1.

    If you still have warning can you at least provide the line numbers they are on.

  7. MattV
    Member
    Posted 2 years ago #

    I´ve updated the plugin from WP´s dashboard and it now shows "Version 0.5.4.1", so that should be ok.

    The alerts are still there unfortunately:

    Notice: Undefined index: HTTPS in /path/to/wordpress-mu-domain-mapping/domain_mapping.php on <strong>line 545 </strong>

    Notice: Undefined index: HTTPS in /path/to/wordpress-mu-domain-mapping/domain_mapping.php on <strong>line 546</strong>

    I´ve cleared my browser cache and checked in different browers. Could it be my server set up?

    Many thanks for your help Ron, let me know if you need more specific information.

  8. Do you have debugging turned on?

  9. MattV
    Member
    Posted 2 years ago #

    Yes, I´ve debugging on while working on a simple theme. I´ll turn it off later. That was actually my initial doubt: if I should just ignore this warning or if it was something important.

  10. elyobo
    Member
    Posted 2 years ago #

    It's a simple error in the code; the author is using an == where there should be an =, which leads to a missing index in the request. I can't upload a patch here, but if you change line 545 from

    $_SERVER[ 'HTTPS' ] == 'Off';

    to

    $_SERVER[ 'HTTPS' ] = 'Off';

    Then you'll fix the error.

  11. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Thanks. An environment that had it set wouldn't see any warnings.

    http://plugins.trac.wordpress.org/timeline?from=2011-07-21T02%3A13%3A58Z&precision=second

  12. elyobo
    Member
    Posted 2 years ago #

    No probs, thanks for the quick application of the fix. The environment will have it set already if it's using HTTPS, so no errors would be seen, but non HTTPS servers with the appropriate PHP error_reporting settings would see it. Aside from the warning, the behaviour was still correct anyway, as it treats the undefined index the same as off :)

  13. MattV
    Member
    Posted 2 years ago #

    Thanks Elyobo and Ron!

    I´ll wait for version 0.5.4.2 to come available on the repo.

  14. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    I´ll wait for version 0.5.4.2 to come available on the repo.

    Don't wait for a release, get the development version (other versions in the sidebar) which has the fix. We don't release a new version every time we fix a warning.

  15. MattV
    Member
    Posted 2 years ago #

    @ron: That makes sense :)

    For others having the same issue:
    Replacing the domain_mapping.php file on the server didn´t work for me: the file was not updated (maybe because the code change is so small).

    So I actually went into the Plugin Editor and updated the script from the WP Dashboard. Here are my fool-proof instructions ;)

    1. Go to "Site Admin" => "Plugins" and click the "Edit" link below the "WordPress MU Domain Mapping" entry.
    2. Make sure the file "wordpress-mu-domain-mapping/domain_mapping.php" is selected in the menu on the right
    3. Copy the code to Notepad++ or any other editor you use
    4. Change line 545 from $_SERVER[ 'HTTPS' ] == 'Off'; to $_SERVER[ 'HTTPS' ] = 'Off';
    5. Update the plugin version number on top from 0.5.4.1 to 0.5.4.2
    6. Paste the updated code in the WP Plugin Editor and hit "Update File"
      Go back to the Plugin menu and make sure the version number is updated to Version 0.5.4.2
  16. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Replacing the domain_mapping.php file on the server didn´t work for me: the file was not updated (maybe because the code change is so small).

    Thanks :) I checked and discovered there's more than one instance of that line of code. I only fixed one of them. I'll see if I can fix the others later today.

  17. elyobo
    Member
    Posted 2 years ago #

    Looks like there are three more in the version I have.

    $ egrep -n -B 1 "HTTPS.* == 'Off" *
    domain_mapping.php-689- if ( false == isset( $_SERVER[ 'HTTPS' ] ) )
    domain_mapping.php:690: $_SERVER[ 'HTTPS' ] == 'Off';
    --
    domain_mapping.php-735- if ( false == isset( $_SERVER[ 'HTTPS' ] ) )
    domain_mapping.php:736: $_SERVER[ 'HTTPS' ] == 'Off';
    --
    domain_mapping.php-781- if ( false == isset( $_SERVER[ 'HTTPS' ] ) )
    domain_mapping.php:782: $_SERVER[ 'HTTPS' ] == 'Off';

  18. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Those would be the ones.

  19. pbarney
    Member
    Posted 2 years ago #

    I found a few other errors in domain_mapping.php, but I can't find a bugtracker or repository for it. Is there an active developer on this project that I can email the changes to?

    Thanks

  20. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    You can drop a note through http://ronandandrea.com/contact/

  21. cbee
    Member
    Posted 1 year ago #

    I have a few notices on my site and hope someone can help!!

    Undefined index: path in /data/xxxxx/xx/xx/xx/xxxx/user/xxx/htdocs/wp-content/plugins/custom-permalinks/custom-permalinks.php on line 261

    etc etc!

    Also, is it unsafe to have those paths displayed publicly? I replaced the numbers with x's above. Please let me know!

  22. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    Turn off WP_DEBUG to remove the notices.

    Are you using the latest version of the plugin?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic