Ticket #10293: 10293.diff
File 10293.diff, 2.7 KB (added by , 14 years ago) |
---|
-
wp-includes/wp-db.php
296 296 var $real_escape = false; 297 297 298 298 /** 299 * Database Username 300 * 301 * @since 2.9.0 302 * @access private 303 * @var string 304 */ 305 var $dbuser; 306 307 /** 299 308 * Connects to the database server and selects a database 300 309 * 301 310 * PHP4 compatibility layer for calling the PHP5 constructor. … … 338 347 if ( defined('DB_COLLATE') ) 339 348 $this->collate = DB_COLLATE; 340 349 350 $this->dbuser = $dbuser; 351 341 352 $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true); 342 353 if (!$this->dbh) { 343 354 $this->bail(sprintf(/*WP_I18N_DB_CONN_ERROR*/" … … 349 360 <li>Are you sure that the database server is running?</li> 350 361 </ul> 351 362 <p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p> 352 "/*/WP_I18N_DB_CONN_ERROR*/, $dbhost) );363 "/*/WP_I18N_DB_CONN_ERROR*/, $dbhost), 'db_connect_fail'); 353 364 return; 354 365 } 355 366 … … 436 447 <li>Does the user <code>%2$s</code> have permission to use the <code>%1$s</code> database?</li> 437 448 <li>On some systems the name of your database is prefixed with your username, so it would be like <code>username_%1$s</code>. Could that be the problem?</li> 438 449 </ul> 439 <p>If you don\'t know how to setup a database you should <strong>contact your host</strong>. If all else fails you may find help at the <a href="http://wordpress.org/support/">WordPress Support Forums</a>.</p>'/*/WP_I18N_DB_SELECT_DB*/, $db, DB_USER));450 <p>If you don\'t know how to setup a database you should <strong>contact your host</strong>. If all else fails you may find help at the <a href="http://wordpress.org/support/">WordPress Support Forums</a>.</p>'/*/WP_I18N_DB_SELECT_DB*/, $db, $this->dbuser), 'db_select_fail'); 440 451 return; 441 452 } 442 453 } … … 996 1007 * 997 1008 * @since 1.5.0 998 1009 * 999 * @param string $message 1010 * @param string $message The Error message 1011 * @param string $code (optional) A Computer readable string to identify the error. 1000 1012 * @return false|void 1001 1013 */ 1002 function bail($message ) {1014 function bail($message, $code = '') { 1003 1015 if ( !$this->show_errors ) { 1004 1016 if ( class_exists('WP_Error') ) 1005 $this->error = new WP_Error('500', $message );1017 $this->error = new WP_Error('500', $message, $code); 1006 1018 else 1007 1019 $this->error = $message; 1008 1020 return false; … … 1035 1047 * 1036 1048 * @return bool True if collation is supported, false if version does not 1037 1049 */ 1038 function supports_collation() 1039 { 1050 function supports_collation() { 1040 1051 return $this->has_cap( 'collation' ); 1041 1052 } 1042 1053