From fc86bfd2fb090ff011b6113544e088f54a1e1b78 Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Thu, 6 Mar 2008 18:23:30 +0000 Subject: [PATCH] Added new hook, 'BrokenLink' --- docs/hooks.txt | 12 ++++++++++++ includes/Linker.php | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index a6f381b509..4fe5326aff 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -462,6 +462,18 @@ $user: the user who did the block (not the one being blocked) $isbn: ISBN to show information for $output: OutputPage object in use +'BrokenLink': Before the HTML is created for a broken (i.e. red) link +&$this: Linker instance +$nt: the page title +$query: the URL query string passed in +&$u: the URL of this link +&$style: the inline CSS style +&$prefix: a prefix prepended to the linked text +&$text: the text placed by the user in the wiki-link +&$inside: any additional alphanumeric characters placed after the wiki-link, +that are made part of the link text +&$trail: text placed immediately after the HTML link + 'CategoryPageView': before viewing a categorypage in CategoryPage::view $catpage: CategoryPage instance diff --git a/includes/Linker.php b/includes/Linker.php index 105e24bb0b..91b6430e1a 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -356,8 +356,9 @@ class Linker { } $titleAttr = wfMsg( 'red-link-title', $titleText ); $style = $this->getInternalLinkAttributesObj( $nt, $text, 'new', $titleAttr ); - list( $inside, $trail ) = Linker::splitTrail( $trail ); + + wfRunHooks( 'BrokenLink', array( &$this, $nt, $query, &$u, &$style, &$prefix, &$text, &$inside, &$trail ) ); $s = "{$prefix}{$text}{$inside}{$trail}"; wfProfileOut( __METHOD__ ); -- 2.20.1