Avoid recording template link to special page in getContent()

Replace Title::isExternal check with !Title::canExist(). The latter
subsumes the former. No content can be retrieved if the page cannot
exist in the database (such as special pages), and hence the
templatelinks row is unnecessary.

Bug: T377530
Change-Id: I44775980c4619f5ef719c6076976dd21095ba6e2
This commit is contained in:
Siddharth VP 2024-11-17 00:43:06 +05:30 committed by jenkins-bot
parent 8a756e79ca
commit 82e5344ead

View file

@ -291,7 +291,7 @@ class TitleLibrary extends LibraryBase {
*/ */
private function getContentInternal( $text ) { private function getContentInternal( $text ) {
$title = Title::newFromText( $text ); $title = Title::newFromText( $text );
if ( !$title || $title->isExternal() ) { if ( !$title || !$title->canExist() ) {
return null; return null;
} }