From: Niklas Laxström Date: Sun, 9 Jan 2011 10:36:13 +0000 (+0000) Subject: * (bug 26638) Database error pages display correctly in RTL languages X-Git-Tag: 1.31.0-rc.0~32682 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=111a166e01aca8a514bb7f25403f79556dd1abd6 * (bug 26638) Database error pages display correctly in RTL languages --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 46589e4baa..ac50703085 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -65,6 +65,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN pages to be queried via the API and Special:ProtectedPages, and allowing disabling upload protection by removing it from $wgRestrictionTypes. * If an edit summary exceeds 250 bytes and is truncated, add an ellipse +* (bug 26638) Database error pages display correctly in RTL languages === API changes in 1.18 === * (bug 26339) Throw warning when truncating an overlarge API result diff --git a/includes/Exception.php b/includes/Exception.php index 5e7e1ca579..76cd6412cc 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -226,7 +226,7 @@ class MWException extends Exception { * $wgOut to output the exception. */ function htmlHeader() { - global $wgLogo, $wgOutputEncoding; + global $wgLogo, $wgOutputEncoding, $wgLang; if ( !headers_sent() ) { header( 'HTTP/1.0 500 Internal Server Error' ); @@ -236,23 +236,29 @@ class MWException extends Exception { header( 'Pragma: nocache' ); } - $logo = htmlspecialchars( $wgLogo, ENT_QUOTES ); - $title = htmlspecialchars( $this->getPageTitle() ); + $title = Html::element( 'title', null, $this->getPageTitle() ); - return " - - $title - - -

$title

- "; + $left = $wgLang->alignStart(); + $right = $wgLang->alignEnd(); + $header = Html::element( 'img', array( + 'src' => $wgLogo, + 'style' => "float: $left; margin-$right: 1em;", + 'alt' => '' ), $this->getPageTitle() ); + + $attribs = array( 'dir' => $wgLang->getDir(), 'lang' => $wgLang->getCode() ); + + return + Html::htmlHeader( $attribs ) . + Html::rawElement( 'head', null, $title ) . "\n". + Html::openElement( 'body' ) . "\n" . + Html::rawElement( 'h1', null, $header ) . "\n"; } /** * print the end of the html page if not using $wgOut. */ function htmlFooter() { - return ""; + return Html::closeElement( 'body' ) . Html::closeElement( 'html' ); } /**