[wp-trac] [WordPress Trac] #15682: Entering invalid DB information causes WP installer to silently die()

WordPress Trac wp-trac at lists.automattic.com
Sun Dec 5 03:48:53 UTC 2010


#15682: Entering invalid DB information causes WP installer to silently die()
-----------------------------+----------------------------------------------
 Reporter:  itsananderson    |       Owner:                 
     Type:  defect (bug)     |      Status:  new            
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Upgrade/Install  |     Version:  3.1            
 Severity:  major            |    Keywords:                 
-----------------------------+----------------------------------------------
 If a user provides invalid database connection information (such as an
 invalid DB username or password) during the installation process, the
 WordPress installer exits without printing any sort of error message.

 I dug around a bit in the source and it looks like the installer attempts
 connect to the database with the provided data, and if wpdb fails to
 connect, it wp_die()s the connection error.

 http://core.trac.wordpress.org/browser/trunk/wp-admin/setup-
 config.php#L180

 The problem is that if there's a problem connecting to the DB, it never
 gets back to setup-config.php, because $wpdb->show_errors is set to false,
 so $wpdb->db_connect() will die() without printing any error message.

 http://core.trac.wordpress.org/browser/trunk/wp-includes/wp-db.php#L1047

 The fix might actually be as simple as 1) setting $wpdb->show_errors to
 true during the install process or 2) not die()ing immediately if there's
 a connection problem. Another option would be to check whether
 WP_INSTALLING is defined before die()ing.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15682>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list