X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FParser.php;h=e7553a294846738e40cebd87bcebc9bc35bb7c4b;hb=3d58f903d84426658300d17da5ccd0e1f2557de5;hp=35f187f4d8e7ba7cd7165e1228cec9e75e46e1e0;hpb=f1c86117a1e6122bcec0ba2a9424e97471d4d93f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 35f187f4d8..e7553a2948 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -2859,7 +2859,8 @@ class Parser { $value = $pageLang->formatNum( SiteStats::edits() ); break; case 'numberofviews': - $value = $pageLang->formatNum( SiteStats::views() ); + global $wgDisableCounters; + $value = !$wgDisableCounters ? $pageLang->formatNum( SiteStats::views() ) : ''; break; case 'currenttimestamp': $value = wfTimestamp( TS_MW, $ts ); @@ -3552,7 +3553,13 @@ class Parser { } if ( $rev ) { - $text = $rev->getText(); + $content = $rev->getContent(); + $text = $content->getWikitextForTransclusion(); + + if ( $text === false || $text === null ) { + $text = false; + break; + } } elseif ( $title->getNamespace() == NS_MEDIAWIKI ) { global $wgContLang; $message = wfMessage( $wgContLang->lcfirst( $title->getText() ) )->inContentLanguage(); @@ -3561,15 +3568,16 @@ class Parser { break; } $text = $message->plain(); + $content = ContentHandler::makeContent( $text, $title ); #TODO: use Message::content() instead, once that exists } else { break; } - if ( $text === false ) { + if ( !$content ) { break; } # Redirect? $finalTitle = $title; - $title = Title::newFromRedirect( $text ); + $title = $content->getRedirectTarget(); } return array( 'text' => $text,