[wp-trac] [WordPress Trac] #29678: Multisite SHORTINIT from outside PATH_CURRENT_SITE

WordPress Trac noreply at wordpress.org
Mon Sep 15 09:58:49 UTC 2014


#29678: Multisite SHORTINIT from outside PATH_CURRENT_SITE
--------------------------------+-----------------------------
 Reporter:  sgissinger          |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Networks and Sites  |    Version:  4.0
 Severity:  normal              |   Keywords:
  Focuses:  multisite           |
--------------------------------+-----------------------------
 We are using Wordpress SHORTINIT to integrate user capabilities and logged
 status in a custom intranet with the following code :
 {{{
 define('SHORTINIT', true);
 define('WP_USE_THEMES', false);

 require_once '/home/www/extranet/wp-load.php';

 require_once ABSPATH . WPINC . '/formatting.php';
 require_once ABSPATH . WPINC . '/capabilities.php';
 require_once ABSPATH . WPINC . '/user.php';
 require_once ABSPATH . WPINC . '/meta.php';
 require_once ABSPATH . WPINC . '/post.php';
 require_once ABSPATH . WPINC . '/pluggable.php';
 wp_cookie_constants();
 }}}

 * {{{/home/www}}} is our DOCUMENT_ROOT
 * PATH_CURRENT_SITE is defined with {{{/extranet}}} subdirectory
 * we need to include this snippet from {{{/intranet}}} subdirectory (for
 example).

 Our WP 3.6.1 worked fine this way but when we updated, WP printed the
 message {{{Error establishing a database connection}}} then exited.

 As a workaround, we replaced line 65 in the file {{{/wp-includes/ms-
 settings.php}}} :
 * {{{$current_blog = get_site_by_path( $domain, $path, 1 );}}}
 with the following
 * {{{$current_blog = get_site_by_path( $domain, PATH_CURRENT_SITE);}}}

 We stated that this was a bug, because it worked before ;-).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29678>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list