[wpmu-trac] [WordPress MU Trac] #1074: external scripts that interact with WPMU fail (redirect to sign-up page)
WordPress MU Trac
wpmu-trac at lists.automattic.com
Sun Jul 26 11:36:55 UTC 2009
#1074: external scripts that interact with WPMU fail (redirect to sign-up page)
----------------------------+-----------------------------------------------
Reporter: leandroNavarro | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: 2.8.2
Component: General | Version:
Severity: normal | Keywords:
----------------------------+-----------------------------------------------
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 $_SERVER['HTTP_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://trac.mu.wordpress.org/ticket/1074>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser
More information about the wpmu-trac
mailing list