X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FOutputPage.php;h=b63e658ddddd8da9e1d1e6f0a5d18683aaced755;hb=c58873fb4213447615761a55fd2be72fa53f8ec2;hp=746cd0e709d61624c8e9cd77fe04fe9ddbd9c86d;hpb=e281c6f699ef154a7c4d6f0ae0ebf1cead7ca3e3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 746cd0e709..b63e658ddd 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1296,7 +1296,6 @@ class OutputPage extends ContextSource { * Return whether user JavaScript is allowed for this page * @deprecated since 1.18 Load modules with ResourceLoader, and origin and * trustworthiness is identified and enforced automagically. - * Will be removed in 1.20. * @return Boolean */ public function isUserJsAllowed() { @@ -2050,7 +2049,7 @@ class OutputPage extends ContextSource { } if ( $this->mArticleBodyOnly ) { - $this->out( $this->mBodytext ); + echo $this->mBodytext; } else { $this->addDefaultModules(); @@ -2079,8 +2078,10 @@ class OutputPage extends ContextSource { * Actually output something with print. * * @param string $ins the string to output + * @deprecated since 1.20 Use echo yourself. */ public function out( $ins ) { + wfDeprecated( __METHOD__, '1.22' ); print $ins; } @@ -2475,7 +2476,7 @@ $templates * @return String: The doctype, opening "", and head element. */ public function headElement( Skin $sk, $includeStyle = true ) { - global $wgContLang; + global $wgContLang, $wgMimeType; $userdir = $this->getLanguage()->getDir(); $sitedir = $wgContLang->getDir(); @@ -2496,10 +2497,22 @@ $templates $ret .= "$openHead\n"; } + if ( !Html::isXmlMimeType( $wgMimeType ) ) { + // Add + // This should be before since it defines the charset used by + // text including the text inside <title>. + // The spec recommends defining XHTML5's charset using the XML declaration + // instead of meta. + // Our XML declaration is output by Html::htmlHeader. + // http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#attr-meta-http-equiv-content-type + // http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#charset + $ret .= Html::element( 'meta', array( 'charset' => 'UTF-8' ) ); + } + $ret .= Html::element( 'title', null, $this->getHTMLTitle() ) . "\n"; $ret .= implode( "\n", array( - $this->getHeadLinks( null, true ), + $this->getHeadLinks(), $this->buildCssLinks(), $this->getHeadScripts(), $this->getHeadItems() @@ -2968,7 +2981,7 @@ $templates // This also enforces $.isReady to be true at </body> which fixes the // mw.loader bug in Firefox with using document.write between </body> // and the DOMContentReady event (bug 47457). - $html = Html::inlineScript( 'jQuery.ready();' ); + $html = Html::inlineScript( 'window.jQuery && jQuery.ready();' ); if ( !$wgResourceLoaderExperimentalAsyncLoading ) { $html .= $this->getScriptsForBottomQueue( false ); @@ -3128,13 +3141,11 @@ $templates } /** - * @param bool $addContentType Whether "<meta>" specifying content type should be returned - * * @return array in format "link name or number => 'link html'". */ - public function getHeadLinksArray( $addContentType = false ) { + public function getHeadLinksArray() { global $wgUniversalEditButton, $wgFavicon, $wgAppleTouchIcon, $wgEnableAPI, - $wgSitename, $wgVersion, $wgHtml5, $wgMimeType, + $wgSitename, $wgVersion, $wgFeed, $wgOverrideSiteFeed, $wgAdvertisedFeedTypes, $wgDisableLangConversion, $wgCanonicalLanguageLinks, $wgRightsPage, $wgRightsUrl; @@ -3143,23 +3154,6 @@ $templates $canonicalUrl = $this->mCanonicalUrl; - if ( $addContentType ) { - if ( $wgHtml5 ) { - # More succinct than <meta http-equiv=Content-Type>, has the - # same effect - $tags['meta-charset'] = Html::element( 'meta', array( 'charset' => 'UTF-8' ) ); - } else { - $tags['meta-content-type'] = Html::element( 'meta', array( - 'http-equiv' => 'Content-Type', - 'content' => "$wgMimeType; charset=UTF-8" - ) ); - $tags['meta-content-style-type'] = Html::element( 'meta', array( // bug 15835 - 'http-equiv' => 'Content-Style-Type', - 'content' => 'text/css' - ) ); - } - } - $tags['meta-generator'] = Html::element( 'meta', array( 'name' => 'generator', 'content' => "MediaWiki $wgVersion", @@ -3377,13 +3371,10 @@ $templates } /** - * @param $unused - * @param bool $addContentType Whether "<meta>" specifying content type should be returned - * * @return string HTML tag links to be put in the header. */ - public function getHeadLinks( $unused = null, $addContentType = false ) { - return implode( "\n", $this->getHeadLinksArray( $addContentType ) ); + public function getHeadLinks() { + return implode( "\n", $this->getHeadLinksArray() ); } /**