From: Mark Holmquist Date: Fri, 22 Feb 2013 00:15:15 +0000 (-0800) Subject: (bug 43661) Add link trail and link prefix to API X-Git-Tag: 1.31.0-rc.0~20582 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=92920e3adbc60dfff08c2fee8927222f8e829a10;p=lhc%2Fweb%2Fwiklou.git (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 --- 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;