message instead of leading the user to make a null edit.
* (bug 52659) mediawiki.notification: Notification area remained visible when
empty and thus was stealing pointer events from links on the page.
+* (bug 26811) When a DBUnexpectedError occurs, DB server hostnames are now
+ hidden unless $wgShowExceptionDetails is true, and $wgShowDBErrorBacktrace
+ no longer applies in such cases.
=== Web API changes in 1.23 ===
* (bug 54884) action=parse&prop=categories now indicates hidden and missing
'DBConnectionError' => 'includes/db/DatabaseError.php',
'DBConnRef' => 'includes/db/LoadBalancer.php',
'DBError' => 'includes/db/DatabaseError.php',
+ 'DBExpectedError' => 'includes/db/DatabaseError.php',
'DBObject' => 'includes/db/DatabaseUtility.php',
'IDatabase' => 'includes/db/Database.php',
'IORMRow' => 'includes/db/IORMRow.php',
/**
* If true, show a backtrace for database errors
+ *
+ * @note This setting only applies when connection errors and query errors are
+ * reported in the normal manner. $wgShowExceptionDetails applies in other cases,
+ * including those in which an uncaught exception is thrown from within the
+ * exception handler.
*/
$wgShowDBErrorBacktrace = false;
$this->db = $db;
parent::__construct( $error );
}
+}
+/**
+ * Base class for the more common types of database errors. These are known to occur
+ * frequently, so we try to give friendly error messages for them.
+ *
+ * @ingroup Database
+ * @since 1.23
+ */
+class DBExpectedError extends DBError {
/**
* @return string
*/
* @return string
*/
protected function getHTMLContent() {
- return '<p>' . nl2br( htmlspecialchars( $this->getMessage() ) ) . '</p>';
+ return '<p>' . nl2br( htmlspecialchars( $this->getTextContent() ) ) . '</p>';
}
}
/**
* @ingroup Database
*/
-class DBConnectionError extends DBError {
+class DBConnectionError extends DBExpectedError {
/** @var string Error text */
public $error;
/**
* @ingroup Database
*/
-class DBQueryError extends DBError {
+class DBQueryError extends DBExpectedError {
public $error, $errno, $sql, $fname;
/**