jenkins-bot has submitted this change and it was merged.

Change subject: T102717: Fix the RDF links always use http:
......................................................................


T102717: Fix the RDF links always use http:

Change-Id: Ifa78d36f639b041d526e065f7d0583f7ce0040ff
---
M repo/includes/rdf/RdfVocabulary.php
M repo/tests/phpunit/includes/rdf/RdfBuilderTestData.php
2 files changed, 16 insertions(+), 3 deletions(-)

Approvals:
  Smalyshev: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/rdf/RdfVocabulary.php 
b/repo/includes/rdf/RdfVocabulary.php
index 7ed998d..3bc09ea 100644
--- a/repo/includes/rdf/RdfVocabulary.php
+++ b/repo/includes/rdf/RdfVocabulary.php
@@ -97,8 +97,8 @@
         * @param string $dataUri Base URI for entity description URIs.
         */
        public function __construct( $baseUri, $dataUri ) {
-               $this->baseUri = $baseUri;
-               $this->dataUri = $dataUri;
+               $this->baseUri = self::alwaysHTTP( $baseUri );
+               $this->dataUri = self::alwaysHTTP( $dataUri );
 
                if( substr($this->baseUri, -7) === 'entity/') {
                        $topUri = substr($this->baseUri, 0, -7);
@@ -215,4 +215,17 @@
                return self::COMMONS_URI . rawurlencode( $file );
        }
 
+       /**
+        * Returns URI that is always http: even if the passed URI is https
+        * @param string $uri
+        * @return string
+        */
+       public static function alwaysHTTP( $uri ) {
+               if( strncasecmp( $uri, 'https://', 8 ) === 0 ) {
+                       // https: becomes http:
+                       $uri = 'http' . substr( $uri, 5 );
+               }
+               return $uri;
+       }
+
 }
diff --git a/repo/tests/phpunit/includes/rdf/RdfBuilderTestData.php 
b/repo/tests/phpunit/includes/rdf/RdfBuilderTestData.php
index 90b9791..b3b4b90 100644
--- a/repo/tests/phpunit/includes/rdf/RdfBuilderTestData.php
+++ b/repo/tests/phpunit/includes/rdf/RdfBuilderTestData.php
@@ -31,7 +31,7 @@
 class RdfBuilderTestData {
 
        const URI_BASE = 'http://acme.test/';
-       const URI_DATA = 'http://data.acme.test/';
+       const URI_DATA = 'https://data.acme.test/';
 
        /**
         * @var EntityContentDataCodec|null

-- 
To view, visit https://gerrit.wikimedia.org/r/218994
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifa78d36f639b041d526e065f7d0583f7ce0040ff
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Smalyshev <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to