From 20b10a889adcf76e4044caae0ee4d28d5b77f7bc Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Thu, 2 Oct 2008 21:04:36 +0000 Subject: [PATCH] Add Linker::link flag for using article path (reapplying from r41410, was not a part that had problems) --- includes/Linker.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/Linker.php b/includes/Linker.php index dd899fec7b..bc9eb69871 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -204,8 +204,18 @@ class Linker { } wfProfileOut( __METHOD__ . '-checkPageExistence' ); + $oldquery = array(); + if( in_array( "forcearticlepath", $options ) && $query ){ + $oldquery = $query; + $query = array(); + } + # Note: we want the href attribute first, for prettiness. $attribs = array( 'href' => $this->linkUrl( $target, $query, $options ) ); + if( in_array( 'forcearticlepath', $options ) && $oldquery ){ + $attribs['href'] = wfAppendQuery( $attribs['href'], wfArrayToCgi( $oldquery ) ); + } + $attribs = array_merge( $attribs, $this->linkAttribs( $target, $customAttribs, $options ) -- 2.20.1