mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-28 09:40:41 +00:00
Merge "(bug 43701) - LinkedPage was linked by 127.0.0.1 from page"
This commit is contained in:
commit
120dfc980c
11
Hooks.php
11
Hooks.php
|
@ -363,19 +363,26 @@ class EchoHooks {
|
|||
* @return bool
|
||||
*/
|
||||
public static function onLinksUpdateAfterInsert( $linksUpdate, $table, $insertions ) {
|
||||
// Confirm: if $linksUpdate->mRecursive is false, that means $linkUpdate->mTitle is
|
||||
// transcluding other page, and this link update is resulting from the other page
|
||||
// link update
|
||||
if ( !$linksUpdate->mRecursive ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Handle only inserts to pagelinks table for content namespace pages
|
||||
if ( $table !== 'pagelinks' || !MWNamespace::isContent( $linksUpdate->mTitle->getNamespace() ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// only create notifications for links to content namespace pages
|
||||
// Only create notifications for links to content namespace pages
|
||||
foreach ( $insertions as $key => $page ) {
|
||||
if ( !MWNamespace::isContent( $page['pl_namespace'] ) ) {
|
||||
unset( $insertions[$key] );
|
||||
}
|
||||
}
|
||||
|
||||
// exits if there is no new link
|
||||
// Exits if there is no new link
|
||||
if ( !$insertions ) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue