From: Alexandre Emsenhuber Date: Thu, 23 Jun 2011 18:42:51 +0000 (+0000) Subject: Fix for r86722: pass the message 'dberrortext' unescaped to the output since it conta... X-Git-Tag: 1.31.0-rc.0~29328 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=f722920ee0c846e4d612d71cd9672cc1a5d6b70f;p=lhc%2Fweb%2Fwiklou.git Fix for r86722: pass the message 'dberrortext' unescaped to the output since it contains. I really don't like to pass unescaped messages to the output *sigh* --- diff --git a/includes/db/DatabaseError.php b/includes/db/DatabaseError.php index 4838d02caa..732b387921 100644 --- a/includes/db/DatabaseError.php +++ b/includes/db/DatabaseError.php @@ -265,13 +265,18 @@ class DBQueryError extends DBError { */ function getContentMessage( $html ) { if ( $this->useMessageCache() ) { - $msg = $html ? 'dberrortext' : 'dberrortextcl'; - $ret = wfMsg( $msg, $this->getSQL(), - $this->fname, $this->errno, $this->error ); if ( $html ) { - $ret = htmlspecialchars( $ret ); + $msg = 'dberrortext'; + $sql = htmlspecialchars( $this->getSQL() ); + $fname = htmlspecialchars( $this->fname ); + $error = htmlspecialchars( $this->error ); + } else { + $msg = 'dberrortextcl'; + $sql = $this->getSQL(); + $fname = $this->fname; + $error = $this->error; } - return $ret; + return wfMsg( $msg, $sql, $fname, $this->errno, $error ); } else { return parent::getContentMessage( $html ); }