Return empty string for trail/prefix if disabled
authorMark Holmquist <mtraceur@member.fsf.org>
Tue, 5 Mar 2013 23:32:52 +0000 (15:32 -0800)
committerMark Holmquist <mtraceur@member.fsf.org>
Tue, 5 Mar 2013 23:32:52 +0000 (15:32 -0800)
This is necessary so Parsoid can know when the API doesn't have the linktrail/
prefix feature and when the API is actually telling us that the trail/prefix
is/are disabled.

Bug: 41151
Change-Id: If0895d507fe1b473e42bceb135d4030106ded442

includes/api/ApiQuerySiteinfo.php

index ac13589..596fd06 100644 (file)
@@ -139,11 +139,15 @@ class ApiQuerySiteinfo extends ApiQueryBase {
 
                if ( $wgContLang->linkPrefixExtension() ) {
                        $data['linkprefix'] = wfMessage( 'linkprefix' )->inContentLanguage()->text();
+               } else {
+                       $data['linkprefix'] = '';
                }
 
                $linktrail = $wgContLang->linkTrail();
                if ( $linktrail ) {
                        $data['linktrail'] = $linktrail;
+               } else {
+                       $data['linktrail'] = '';
                }
 
                $git = SpecialVersion::getGitHeadSha1( $GLOBALS['IP'] );