Nik has submitted this change and it was merged.

Change subject: Create Wikibase URL if it's a Wikibase item.
......................................................................


Create Wikibase URL if it's a Wikibase item.

Change-Id: I58204b4cfa72b843795a79f985da922a44feee62
---
M PubSubHubbub.body.php
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  Nik: Verified; Looks good to me, approved



diff --git a/PubSubHubbub.body.php b/PubSubHubbub.body.php
index 39f5bb7..6d438c9 100644
--- a/PubSubHubbub.body.php
+++ b/PubSubHubbub.body.php
@@ -44,6 +44,14 @@
        }
 
        public static function getPageURL( $title ) {
+               if ( defined( 'WB_VERSION' ) ) {
+                       // Wikibase extension is installed
+                       if ( \Wikibase\NamespaceUtils::isEntityNamespace( 
$title->getNamespace() ) ) {
+                               $specialTitle = \Title::makeTitle( -1, 
'EntityData' );
+                               return $specialTitle->getCanonicalURL() . "/" . 
$title->getBaseText() . '.json';
+                       }
+               }
+
                return $title->getCanonicalURL( array(
                        'action' => 'raw'
                ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I58204b4cfa72b843795a79f985da922a44feee62
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/PubSubHubbub
Gerrit-Branch: master
Gerrit-Owner: Nik <[email protected]>
Gerrit-Reviewer: Alexander.lehmann 
<[email protected]>
Gerrit-Reviewer: Nik <[email protected]>

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

Reply via email to