mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-23 15:36:47 +00:00
Use WikiPageFactory to create WikiPage object
Bug: T297688 Change-Id: I5e6da574bd1377b492005adbc1aff3e97fe9c31b
This commit is contained in:
parent
11cde1c520
commit
560819e270
|
@ -20,7 +20,6 @@ use RequestContext;
|
|||
use ResourceLoader;
|
||||
use Status;
|
||||
use Title;
|
||||
use WikiPage;
|
||||
|
||||
/**
|
||||
* Hooks for TemplateData extension
|
||||
|
@ -259,6 +258,7 @@ class Hooks {
|
|||
$tplData = [];
|
||||
|
||||
$pageProps = MediaWikiServices::getInstance()->getPageProps();
|
||||
$wikiPageFactory = MediaWikiServices::getInstance()->getWikiPageFactory();
|
||||
|
||||
// This inefficient implementation is currently tuned for
|
||||
// Parsoid's use case where it requests info for exactly one title.
|
||||
|
@ -272,7 +272,7 @@ class Hooks {
|
|||
}
|
||||
|
||||
if ( $title->isRedirect() ) {
|
||||
$title = ( new WikiPage( $title ) )->getRedirectTarget();
|
||||
$title = $wikiPageFactory->newFromTitle( $title )->getRedirectTarget();
|
||||
if ( !$title ) {
|
||||
// Invalid redirecting title
|
||||
$tplData[$tplTitle] = null;
|
||||
|
|
Loading…
Reference in a new issue