create_empty_blog() bug?
-
Hi, I just came across this which is I think is a(are) bug(s)
1.) on create_empty_blog() $weblog_title is not used, so it creates a blog with no blogname which causes bug #2function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) { $domain = addslashes( $domain ); $weblog_title = addslashes( $weblog_title ); if ( empty($path) ) $path = '/'; // Check if the domain has been used already. We should return an error message. if ( domain_exists($domain, $path, $site_id) ) return __( 'Error: Site URL already taken.' ); // Need to backup wpdb table names, and create a new wp_blogs entry for new blog. // Need to get blog_id from wp_blogs, and create new table names. // Must restore table names at the end of function. if ( ! $blog_id = insert_blog($domain, $path, $site_id) ) return __( 'Error: problem creating site entry.' ); switch_to_blog($blog_id); install_blog($blog_id); restore_current_blog(); return $blog_id; }
2.) when the blog name is blank, ALL permalinks will appear to be broken and return the 404 page of the blog.
BTW I’m pretty sure I’m passing a correct parameter on the $weblog_title cause I tried echo()’ing it inside the create_empty_blog() function
maybe I’ll try using wp_create_blog() instead of doing this
If this is bug, I hope I helped
If this is not, I hope I get enlightened
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘create_empty_blog() bug?’ is closed to new replies.