mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-09-23 18:30:32 +00:00
Record a link to pages looked up by ID
If mw.title.new is called with a page ID, record a link to it. Change-Id: Idc5327d21b780ff8242367878102034413663643
This commit is contained in:
parent
ce5ac6611d
commit
15203e9b72
|
@ -150,6 +150,11 @@ class Scribunto_LuaTitleLibrary extends Scribunto_LuaLibraryBase {
|
|||
$this->incrementExpensiveFunctionCount();
|
||||
$title = Title::newFromID( $text_or_id );
|
||||
$this->idCache[$text_or_id] = $title;
|
||||
|
||||
// Record a link
|
||||
if ( $this->getParser() && $title && !$title->equals( $this->getTitle() ) ) {
|
||||
$this->getParser()->getOutput()->addLink( $title );
|
||||
}
|
||||
}
|
||||
if ( $title ) {
|
||||
$this->titleCache[$title->getPrefixedDBkey()] = $title;
|
||||
|
|
Loading…
Reference in a new issue