From a44c6df5ec95099f1850236b2120cb365bb094c7 Mon Sep 17 00:00:00 2001 From: Tom Gilder Date: Mon, 7 Feb 2005 14:11:59 +0000 Subject: [PATCH] Always include xmlns and xml:lang even when serving non-XHTML MIME type --- includes/OutputPage.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 96543bac23..61356299e1 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -729,8 +729,7 @@ class OutputPage { global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType; global $wgUser, $wgContLang, $wgRequest; - $xml = ($wgMimeType == 'text/xml' || $wgMimeType == 'application/xhtml+xml' || $wgMimeType == 'application/xml'); - if( $xml ) { + if( $wgMimeType == 'text/xml' || $wgMimeType == 'application/xhtml+xml' || $wgMimeType == 'application/xml' ) { $ret = "<" . "?xml version=\"1.0\" encoding=\"$wgOutputEncoding\" ?" . ">\n"; } else { $ret = ''; @@ -741,13 +740,9 @@ class OutputPage { if ( "" == $this->mHTMLtitle ) { $this->mHTMLtitle = wfMsg( "pagetitle", $this->mPagetitle ); } - if( $xml ) { - $xmlbits = "xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"$wgContLanguageCode\""; - } else { - $xmlbits = ''; - } + $rtl = $wgContLang->isRTL() ? " dir='RTL'" : ''; - $ret .= "\n"; + $ret .= "\n"; $ret .= "\n" . htmlspecialchars( $this->mHTMLtitle ) . "\n"; array_push( $this->mMetatags, array( "http:Content-type", "$wgMimeType; charset={$wgOutputEncoding}" ) ); -- 2.20.1