Smalyshev has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/218994

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
1 file changed, 14 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/94/218994/1

diff --git a/repo/includes/rdf/RdfVocabulary.php 
b/repo/includes/rdf/RdfVocabulary.php
index 7ed998d..1ab4ed4 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,16 @@
                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( strtolower( substr( $uri, 0, 8 ) ) === "https://"; ) {
+                       $uri = 'http:' . substr( $uri, 6 );
+               }
+               return $uri;
+       }
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa78d36f639b041d526e065f7d0583f7ce0040ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Smalyshev <smalys...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to