http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90668

Revision: 90668
Author:   ialex
Date:     2011-06-23 18:42:51 +0000 (Thu, 23 Jun 2011)
Log Message:
-----------
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*

Modified Paths:
--------------
    trunk/phase3/includes/db/DatabaseError.php

Modified: trunk/phase3/includes/db/DatabaseError.php
===================================================================
--- trunk/phase3/includes/db/DatabaseError.php  2011-06-23 17:20:54 UTC (rev 
90667)
+++ trunk/phase3/includes/db/DatabaseError.php  2011-06-23 18:42:51 UTC (rev 
90668)
@@ -265,13 +265,18 @@
         */
        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 );
                }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to