r87628 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87627‎ | r87628 | r87629 >
Date:13:24, 7 May 2011
Author:happy-melon
Status:ok (Comments)
Tags:
Comment:
(bug 28834) Restore nl2br() wrappers removed in r85918.
Modified paths:
  • /trunk/phase3/includes/Exception.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Exception.php
@@ -493,7 +493,7 @@
494494 if ( $cmdLine ) {
495495 wfPrintError( $message );
496496 } else {
497 - wfDie( htmlspecialchars( $message ) ) . "\n";
 497+ wfDie( nl2br( htmlspecialchars( $message ) ) ) . "\n";
498498 }
499499 }
500500 } else {
@@ -507,7 +507,7 @@
508508 if ( $cmdLine ) {
509509 wfPrintError( $message );
510510 } else {
511 - wfDie( htmlspecialchars( $message ) ) . "\n";
 511+ wfDie( nl2br( htmlspecialchars( $message ) ) ) . "\n";
512512 }
513513 }
514514 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r92328REL1_18 MFT r79056, r80612, r81499, r87627, r87628, r87630, r87998, r88134, r...reedy22:46, 15 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85918Improvements to handling of 'catastrophic' errors, like unsupported PHP versi...happy-melon20:38, 12 April 2011

Comments

#Comment by Bryan (talk | contribs)   13:31, 7 May 2011

Shouldn't the second parameter of nl2br ($is_xhtml) be set, depending on $wgWellFormedXml?

#Comment by Happy-melon (talk | contribs)   14:13, 7 May 2011

No because a) the parameter was added in PHP 5.3 and so may not be available, and (more importantly) b) wfDie() does not assume that it is able to access the value of $wgWellFormedXml in either LocalSettings or DefaultSettings, and so unconditionally outputs an XHTML 1.0 Transitional doctype, regardless of the general state of the wiki.

Status & tagging log