From 9501ff721d6553ce1a0893947cb7953cd98bc842 Mon Sep 17 00:00:00 2001 From: nacin Date: Mon, 16 Apr 2012 21:55:47 +0000 Subject: [PATCH] Escape special characters when outputting DB failures. see #13839. git-svn-id: http://svn.automattic.com/wordpress/trunk@20483 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/wp-db.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index d616e95321..f418745929 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -754,7 +754,7 @@ class wpdb {
  • Does the user %2$s have permission to use the %1$s database?
  • On some systems the name of your database is prefixed with your username, so it would be like username_%1$s. Could that be the problem?
  • -

    If you don\'t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.

    ' ), $db, $this->dbuser ), 'db_select_fail' ); +

    If you don\'t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.

    ' ), htmlspecialchars( $db, ENT_QUOTES ), htmlspecialchars( $this->dbuser, ENT_QUOTES ) ), 'db_select_fail' ); return; } } @@ -1051,7 +1051,7 @@ class wpdb {
  • Are you sure that the database server is running?
  • If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

    -" ), $this->dbhost ), 'db_connect_fail' ); +" ), htmlspecialchars( $this->dbhost, ENT_QUOTES ) ), 'db_connect_fail' ); return; }