The MU forums have moved to WordPress.org

Install Fixes (4 posts)

  1. hroberts
    Inactive
    Posted 20 years ago #

    I had to make the changes in the below diff to the 2005-12-17 nightly, one to make cookies work and the other to figure out the blog name from a url with a cgi param. Also, I had to copy htaccess.dist to .htaccess and replace 'BASE' with '' in that file. I'm not sure if these are bugs in this particular nightly or if I mucked something up in the process, but I'm providing them in case they help other folks. I'm still testing, but everything seems to be working well now.

    The symptoms for me were 1) getting a blog not found error (fixed by the param fix in the diff below), then 2) getting thrown back to the login page with no error message on what should have been a successful login (fixed by uncommenting the cookie settings in the diff below), and then 3) not being able to find a newly created blog (fixed by copying and editing the .htaccess file).

  2. hroberts
    Inactive
    Posted 20 years ago #

    Whoops. Here's the diff:

    diff -u -r wpmu-2005-12-17/wp-inst/wp-settings.php wpmu/wp-inst/wp-settings.php
    --- wpmu-2005-12-17/wp-inst/wp-settings.php 2005-12-08 08:19:28.000000000 -0500
    +++ wpmu/wp-inst/wp-settings.php 2005-12-17 21:36:12.393206637 -0500
    @@ -115,8 +115,12 @@
    } else {
    $wpblog = str_replace( $base, '', $_SERVER[ 'REQUEST_URI' ] );
    }
    +
    if( strpos( $wpblog, '/' ) )
    $wpblog = substr( $wpblog, 0, strpos( $wpblog, '/' ) );
    + if( strpos( $wpblog, '?' ) )
    + $wpblog = substr( $wpblog, 0, strpos( $wpblog, '?' ) );
    +
    if( $wpblog == '' || file_exists( ABSPATH . $wpblog ) || is_dir( ABSPATH . $wpblog ) ) {
    $searchdomain = $domain;
    } else {
    @@ -294,6 +298,7 @@
    $cookiehash = ''; // Remove in 1.4
    define('COOKIEHASH', '');
    endif;
    +*/

    if ( !defined('USER_COOKIE') )
    define('USER_COOKIE', 'wordpressuser_'. COOKIEHASH);
    @@ -305,7 +310,6 @@
    define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('siteurl') . '/' ) );
    if ( !defined('COOKIE_DOMAIN') )
    define('COOKIE_DOMAIN', false);
    -*/

    require (ABSPATH . WPINC . '/vars.php');

  3. kalam
    Inactive
    Posted 20 years ago #

    in plain English
    What does this do ??

    +
    if( strpos( $wpblog, '/' ) )
    $wpblog = substr( $wpblog, 0, strpos( $wpblog, '/' ) );
    + if( strpos( $wpblog, '?' ) )
    + $wpblog = substr( $wpblog, 0, strpos( $wpblog, '?' ) );
    +

  4. hroberts
    Inactive
    Posted 20 years ago #

    That bit of code is breaking up the url to figure out what the path name of the blog is, so it looks at:

    http://foo.bar/fooblog/wp-admin

    and figures out that the hostname is 'foo.blog' and the blog name is 'fooblog'. The existing code was breaking on something like:

    http://foo.bar/fooblog/wp-admin?foo=bar

    So that the system though that the hostname was 'foo.bar' and the blog name was 'fooblog/wp-admin?foo=bar'. The visible symptom was the system complaining about not being able to find the blog in the wp_blogs table with a somewhat misleading error message suggesting that the database did not include all of the necessary tables (which it did).

About this Topic

  • Started 20 years ago by hroberts
  • Latest reply from hroberts