r79880 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79879‎ | r79880 | r79881 >
Date:10:36, 9 January 2011
Author:nikerabbit
Status:resolved
Tags:
Comment:
* (bug 26638) Database error pages display correctly in RTL languages
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Exception.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Exception.php
@@ -226,7 +226,7 @@
227227 * $wgOut to output the exception.
228228 */
229229 function htmlHeader() {
230 - global $wgLogo, $wgOutputEncoding;
 230+ global $wgLogo, $wgOutputEncoding, $wgLang;
231231
232232 if ( !headers_sent() ) {
233233 header( 'HTTP/1.0 500 Internal Server Error' );
@@ -236,23 +236,29 @@
237237 header( 'Pragma: nocache' );
238238 }
239239
240 - $logo = htmlspecialchars( $wgLogo, ENT_QUOTES );
241 - $title = htmlspecialchars( $this->getPageTitle() );
 240+ $title = Html::element( 'title', null, $this->getPageTitle() );
242241
243 - return "<html>
244 - <head>
245 - <title>$title</title>
246 - </head>
247 - <body>
248 - <h1><img src='$logo' style='float:left;margin-right:1em' alt=''/>$title</h1>
249 - ";
 242+ $left = $wgLang->alignStart();
 243+ $right = $wgLang->alignEnd();
 244+ $header = Html::element( 'img', array(
 245+ 'src' => $wgLogo,
 246+ 'style' => "float: $left; margin-$right: 1em;",
 247+ 'alt' => '' ), $this->getPageTitle() );
 248+
 249+ $attribs = array( 'dir' => $wgLang->getDir(), 'lang' => $wgLang->getCode() );
 250+
 251+ return
 252+ Html::htmlHeader( $attribs ) .
 253+ Html::rawElement( 'head', null, $title ) . "\n".
 254+ Html::openElement( 'body' ) . "\n" .
 255+ Html::rawElement( 'h1', null, $header ) . "\n";
250256 }
251257
252258 /**
253259 * print the end of the html page if not using $wgOut.
254260 */
255261 function htmlFooter() {
256 - return "</body></html>";
 262+ return Html::closeElement( 'body' ) . Html::closeElement( 'html' );
257263 }
258264
259265 /**
Index: trunk/phase3/RELEASE-NOTES
@@ -65,6 +65,7 @@
6666 pages to be queried via the API and Special:ProtectedPages, and allowing
6767 disabling upload protection by removing it from $wgRestrictionTypes.
6868 * If an edit summary exceeds 250 bytes and is truncated, add an ellipse
 69+* (bug 26638) Database error pages display correctly in RTL languages
6970
7071 === API changes in 1.18 ===
7172 * (bug 26339) Throw warning when truncating an overlarge API result

Follow-up revisions

RevisionCommit summaryAuthorDate
r79903Follow-up r79880: check if $wgLang can be used....nikerabbit17:08, 9 January 2011

Status & tagging log