From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- includes/parser/CoreLinkFunctions.php | 92 ----------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 includes/parser/CoreLinkFunctions.php (limited to 'includes/parser/CoreLinkFunctions.php') diff --git a/includes/parser/CoreLinkFunctions.php b/includes/parser/CoreLinkFunctions.php deleted file mode 100644 index 1cabf766..00000000 --- a/includes/parser/CoreLinkFunctions.php +++ /dev/null @@ -1,92 +0,0 @@ -setLinkHook( NS_CATEGORY, array( __CLASS__, 'categoryLinkHook' ) ); - return true; - } - - /** - * @param $parser Parser - * @param $holders LinkHolderArray - * @param $markers LinkMarkerReplacer - * @param Title $title - * @param $titleText - * @param null $displayText - * @param bool $leadingColon - * @return bool - */ - static function defaultLinkHook( $parser, $holders, $markers, - Title $title, $titleText, &$displayText = null, &$leadingColon = false ) { - if( isset( $displayText ) && $markers->findMarker( $displayText ) ) { - # There are links inside of the displayText - # For backwards compatibility the deepest links are dominant so this - # link should not be handled - $displayText = $markers->expand( $displayText ); - # Return false so that this link is reverted back to WikiText - return false; - } - return $holders->makeHolder( $title, isset( $displayText ) ? $displayText : $titleText, array(), '', '' ); - } - - /** - * @param $parser Parser - * @param $holders LinkHolderArray - * @param $markers LinkMarkerReplacer - * @param Title $title - * @param $titleText - * @param null $sortText - * @param bool $leadingColon - * @return bool|string - */ - static function categoryLinkHook( $parser, $holders, $markers, - Title $title, $titleText, &$sortText = null, &$leadingColon = false ) { - global $wgContLang; - # When a category link starts with a : treat it as a normal link - if( $leadingColon ) return true; - if( isset( $sortText ) && $markers->findMarker( $sortText ) ) { - # There are links inside of the sortText - # For backwards compatibility the deepest links are dominant so this - # link should not be handled - $sortText = $markers->expand( $sortText ); - # Return false so that this link is reverted back to WikiText - return false; - } - if( !isset( $sortText ) ) $sortText = $parser->getDefaultSort(); - $sortText = Sanitizer::decodeCharReferences( $sortText ); - $sortText = str_replace( "\n", '', $sortText ); - $sortText = $wgContLang->convertCategoryKey( $sortText ); - $parser->mOutput->addCategory( $title->getDBkey(), $sortText ); - return ''; - } - -} -- cgit v1.2.3-54-g00ecf