(bug 43661) Add link trail and link prefix to API
authorMark Holmquist <mtraceur@member.fsf.org>
Fri, 22 Feb 2013 00:15:15 +0000 (16:15 -0800)
committerMark Holmquist <mtraceur@member.fsf.org>
Mon, 25 Feb 2013 19:46:07 +0000 (11:46 -0800)
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
includes/api/ApiQuerySiteinfo.php

index 59199db..80266c6 100644 (file)
@@ -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.
index 19382f8..ac13589 100644 (file)
@@ -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;