Nik has uploaded a new change for review.

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

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PubSubHubbub 
refs/changes/56/112656/1

diff --git a/PubSubHubbub.body.php b/PubSubHubbub.body.php
index 134317c..499259c 100644
--- a/PubSubHubbub.body.php
+++ b/PubSubHubbub.body.php
@@ -39,6 +39,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: newchange
Gerrit-Change-Id: I58204b4cfa72b843795a79f985da922a44feee62
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PubSubHubbub
Gerrit-Branch: master
Gerrit-Owner: Nik <[email protected]>

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

Reply via email to