summaryrefslogtreecommitdiffstats
path: root/wp-includes/wp-db.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-01-08 18:25:37 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-01-08 18:25:37 +0000
commitbb3e16e9745abc5d625a8254303c3875c7a04ebf (patch)
tree105f7abc052be575a643971ab59b3b38f4fa7056 /wp-includes/wp-db.php
parent11571c1befd735bd1d69caea2b093164215b4fee (diff)
downloadwordpress-mu-bb3e16e9745abc5d625a8254303c3875c7a04ebf.tar.gz
wordpress-mu-bb3e16e9745abc5d625a8254303c3875c7a04ebf.tar.xz
wordpress-mu-bb3e16e9745abc5d625a8254303c3875c7a04ebf.zip
WP Merge to 4701
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@832 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/wp-db.php')
-rw-r--r--wp-includes/wp-db.php22
1 files changed, 17 insertions, 5 deletions
diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php
index ceab53f..1ed50b4 100644
--- a/wp-includes/wp-db.php
+++ b/wp-includes/wp-db.php
@@ -45,11 +45,13 @@ class wpdb {
* @param string $dbhost
*/
function wpdb($dbuser, $dbpassword, $dbname, $dbhost) {
-
- if( defined( "WP_USE_MULTIPLE_DB" ) && CONSTANT( "WP_USE_MULTIPLE_DB" ) == true ) {
+ if( defined( "WP_USE_MULTIPLE_DB" ) && CONSTANT( "WP_USE_MULTIPLE_DB" ) == true )
$this->db_connect();
- return true;
- }
+ return $this->__construct($dbuser, $dbpassword, $dbname, $dbhost);
+ }
+
+ function __construct($dbuser, $dbpassword, $dbname, $dbhost) {
+ register_shutdown_function(array(&$this, "__destruct"));
$this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);
if (!$this->dbh) {
@@ -68,6 +70,10 @@ class wpdb {
$this->select($dbname, $this->dbh);
}
+ function __destruct() {
+ return true;
+ }
+
/**
* Selects a database using the current class's $this->dbh
* @param string $db name
@@ -420,6 +426,12 @@ class wpdb {
return false;
header('Content-Type: text/html; charset=utf-8');
+
+ if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') )
+ $admin_dir = '';
+ else
+ $admin_dir = 'wp-admin/';
+
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -465,7 +477,7 @@ class wpdb {
</style>
</head>
<body>
- <h1 id="logo"><img alt="WordPress" src="<?php echo "wp-admin/images/wordpress-logo.png" ?>/></h1>
+ <h1 id="logo"><img alt="WordPress" src="<?php echo $admin_dir; ?>images/wordpress-logo.png" /></h1>
<p><?php echo $message; ?></p>
</body>
</html>