Merge "Fix ApiQuerySiteInfo with siprop=rightsinfo to not die if your wgRightsPage...
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 6 Apr 2015 19:32:02 +0000 (19:32 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 6 Apr 2015 19:32:02 +0000 (19:32 +0000)
includes/api/ApiQuerySiteinfo.php

index 5ac1036..d4f7e6a 100644 (file)
@@ -674,8 +674,14 @@ class ApiQuerySiteinfo extends ApiQueryBase {
 
        protected function appendRightsInfo( $property ) {
                $config = $this->getConfig();
-               $title = Title::newFromText( $config->get( 'RightsPage' ) );
-               $url = $title ? wfExpandUrl( $title->getFullURL(), PROTO_CURRENT ) : $config->get( 'RightsUrl' );
+               $rightsPage = $config->get( 'RightsPage' );
+               if ( is_string( $rightsPage ) ) {
+                       $title = Title::newFromText( $rightsPage );
+                       $url = wfExpandUrl( $title, PROTO_CURRENT );
+               } else {
+                       $title = false;
+                       $url = $config->get( 'RightsUrl' );
+               }
                $text = $config->get( 'RightsText' );
                if ( !$text && $title ) {
                        $text = $title->getPrefixedText();