From 92920e3adbc60dfff08c2fee8927222f8e829a10 Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Thu, 21 Feb 2013 16:15:15 -0800 Subject: [PATCH] (bug 43661) Add link trail and link prefix to API This is more than just fetching messages -- we also check whether the messages are enabled via the preferences and configuration. If not, the variables won't be there. Change-Id: If617f43004dbd42f7eaa6f75010cdc5a0a662f60 --- RELEASE-NOTES-1.21 | 2 ++ includes/api/ApiQuerySiteinfo.php | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21 index 59199db967..80266c6736 100644 --- a/RELEASE-NOTES-1.21 +++ b/RELEASE-NOTES-1.21 @@ -224,6 +224,8 @@ production. * (bug 43251) prop=pageprops&ppprop= now accepts multiple props to query. * ApiQueryImageInfo will now limit the number of calls to File::transform made in any one query. If there are too many, iicontinue will be returned. +* action=query&meta=siteinfo&siprop=general will now return the regexes used for + link trails and link prefices. Added for Parsoid support. === API internal changes in 1.21 === * For debugging only, a new global $wgDebugAPI removes many API restrictions when true. diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 19382f8412..ac13589b07 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -137,6 +137,15 @@ class ApiQuerySiteinfo extends ApiQueryBase { $data['titleconversion'] = ''; } + if ( $wgContLang->linkPrefixExtension() ) { + $data['linkprefix'] = wfMessage( 'linkprefix' )->inContentLanguage()->text(); + } + + $linktrail = $wgContLang->linkTrail(); + if ( $linktrail ) { + $data['linktrail'] = $linktrail; + } + $git = SpecialVersion::getGitHeadSha1( $GLOBALS['IP'] ); if ( $git ) { $data['git-hash'] = $git; -- 2.20.1