The MU forums have moved to WordPress.org

Possible bug fix (2 posts)

  1. macgruder
    Member
    Posted 19 years ago #

    I was having trouble with being unable to log out the 'admin' user when using non-vhost. I'm wondering if this is due to a *possible* bug.

    In the wp-settings file you have these lines:

    if( $base == '/' ) {
    $wpblog = substr( $_SERVER[ 'REQUEST_URI' ], 1 );
    } else {
    $wpblog = str_replace( $base, '', $_SERVER[ 'REQUEST_URI' ] );
    }

    BUT REQUEST_URI will include any query string as far as I can see for cases where the mod_rewrite doesn't kick in (logout for example).

    I think if we use this instead we get the same result but minus the query string, which I don't think is ever needed here:

    if( $base == '/' ) {
    $wpblog = substr( $_SERVER[ 'SCRIPT_URL' ], 1 );
    } else {
    $wpblog = str_replace( $base, '', $_SERVER[ 'SCRIPT_URL' ] );
    }

    I haven't tested this so I may be way off :-)

  2. TomK32
    Member
    Posted 19 years ago #

    heh, I've stumbled over a similar part of code about the same nasty problem.
    My personal opinion is to move away from such adventures recognition methods and use mod_rewrite too give wpblog directly to the scripts. And also to have a default wpblog because that's also causing some errors.

About this Topic

  • Started 19 years ago by macgruder
  • Latest reply from TomK32