Merge "(bug 43701) - LinkedPage was linked by 127.0.0.1 from page"

This commit is contained in:
jenkins-bot 2013-01-15 23:44:20 +00:00 committed by Gerrit Code Review
commit 120dfc980c

View file

@ -363,19 +363,26 @@ class EchoHooks {
* @return bool * @return bool
*/ */
public static function onLinksUpdateAfterInsert( $linksUpdate, $table, $insertions ) { 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 // Handle only inserts to pagelinks table for content namespace pages
if ( $table !== 'pagelinks' || !MWNamespace::isContent( $linksUpdate->mTitle->getNamespace() ) ) { if ( $table !== 'pagelinks' || !MWNamespace::isContent( $linksUpdate->mTitle->getNamespace() ) ) {
return true; 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 ) { foreach ( $insertions as $key => $page ) {
if ( !MWNamespace::isContent( $page['pl_namespace'] ) ) { if ( !MWNamespace::isContent( $page['pl_namespace'] ) ) {
unset( $insertions[$key] ); unset( $insertions[$key] );
} }
} }
// exits if there is no new link // Exits if there is no new link
if ( !$insertions ) { if ( !$insertions ) {
return true; return true;
} }