Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2829,13 +2829,20 @@ |
2830 | 2830 | public function getJSVars() { |
2831 | 2831 | global $wgUseAjax, $wgEnableMWSuggest; |
2832 | 2832 | |
| 2833 | + $latestRevID = 0; |
| 2834 | + $pageID = 0; |
| 2835 | + $canonicalName = false; # bug 21115 |
| 2836 | + |
2833 | 2837 | $title = $this->getTitle(); |
2834 | 2838 | $ns = $title->getNamespace(); |
2835 | 2839 | $nsname = MWNamespace::exists( $ns ) ? MWNamespace::getCanonicalName( $ns ) : $title->getNsText(); |
| 2840 | + |
2836 | 2841 | if ( $ns == NS_SPECIAL ) { |
2837 | 2842 | list( $canonicalName, /*...*/ ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); |
2838 | | - } else { |
2839 | | - $canonicalName = false; # bug 21115 |
| 2843 | + } elseif ( $this->canUseWikiPage() ) { |
| 2844 | + $wikiPage = $this->getWikiPage(); |
| 2845 | + $latestRevID = $wikiPage->getLatest(); |
| 2846 | + $pageID = $wikiPage->getId(); |
2840 | 2847 | } |
2841 | 2848 | |
2842 | 2849 | $lang = $title->getPageLanguage(); |
— | — | @@ -2860,8 +2867,8 @@ |
2861 | 2868 | 'wgNamespaceNumber' => $title->getNamespace(), |
2862 | 2869 | 'wgPageName' => $title->getPrefixedDBKey(), |
2863 | 2870 | 'wgTitle' => $title->getText(), |
2864 | | - 'wgCurRevisionId' => $title->getLatestRevID(), |
2865 | | - 'wgArticleId' => $title->getArticleId(), |
| 2871 | + 'wgCurRevisionId' => $latestRevID, |
| 2872 | + 'wgArticleId' => $pageID, |
2866 | 2873 | 'wgIsArticle' => $this->isArticle(), |
2867 | 2874 | 'wgAction' => Action::getActionName( $this->getContext() ), |
2868 | 2875 | 'wgUserName' => $this->getUser()->isAnon() ? null : $this->getUser()->getName(), |