[wp-trac] [WordPress Trac] #12038: external scripts that interact with WPMU fail (redirect to sign-up page)
WordPress Trac
wp-trac at lists.automattic.com
Tue Jan 26 17:07:14 UTC 2010
#12038: external scripts that interact with WPMU fail (redirect to sign-up page)
--------------------------+-------------------------------------------------
Reporter: wpmuguru | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Unassigned
Component: Multisite | Version:
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
MU Trac Ticket: http://trac.mu.wordpress.org/ticket/1074
require('/home/httpd/htdocs/wordpress-mu/wp-blog-header.php'); in a script
that interacts with WPMU fails as internally there is a redirect to the
sign-up page, and therefore the php code below doesn't have a chance to
run.
The reason is wpmu-settings.php line 119: $current_blog = $wpdb->get_row(
$wpdb->prepare("SELECT * FROM $wpdb->blogs WHERE domain = %s", $domain) );
does not work as $domain is guessed from $_SERVERHTTP_HOST? but in my
system that does not give useful info.
Adding the following line it works (it gets $current_blog from
$current_site->domain instead):
if (!$current_blog) $current_blog = $wpdb->get_row( $wpdb->prepare("SELECT
* FROM $wpdb->blogs WHERE domain = %s", $current_site->domain) );
A similar problem may happen at line 149 but I could not check it.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12038>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list