[wp-trac] [WordPress Trac] #29794: Function is_blog_installed returns database connection error if "siteurl" is empty
WordPress Trac
noreply at wordpress.org
Mon Sep 29 13:57:49 UTC 2014
#29794: Function is_blog_installed returns database connection error if "siteurl"
is empty
----------------------------+-----------------------------
Reporter: danielkanchev | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bootstrap/Load | Version: trunk
Severity: normal | Keywords:
Focuses: |
----------------------------+-----------------------------
If the "siteurl" is an empty string then WordPress shows an error message
that is not correct:
"Error establishing a database connection"
The function which handles this is "is_blog_installed":
{{{
1274 // If siteurl is not set to autoload, check it specifically
1275 if ( !isset( $alloptions['siteurl'] ) )
1276 $installed = $wpdb->get_var( "SELECT option_value
FROM $wpdb->options WHERE option_name = 'siteurl'" );
1279 else
1280 $installed = $alloptions['siteurl'];
1281 $wpdb->suppress_errors( $suppress );
}}}
I understand that due to security issues it is logical to show a generic
error message but right now the error has nothing to do with the fact that
the "siteurl" is an empty string and the error just guides people in the
wrong direction. Maybe a check should be added, so that in case the
"siteurl" is not a valid hostname a different generic error will be
displayed?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29794>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list