Nik has uploaded a new change for review.

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


Change subject: Replaced manual URL generation by retrieving from API.
......................................................................

Replaced manual URL generation by retrieving from API.

Change-Id: Ia2ae968c0186c91dc9401c58840f13c1ab9882e8
---
M PubSubHubbub.body.php
M PublishChangesJob.php
2 files changed, 8 insertions(+), 2 deletions(-)


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

diff --git a/PubSubHubbub.body.php b/PubSubHubbub.body.php
index c175c96..42132f2 100644
--- a/PubSubHubbub.body.php
+++ b/PubSubHubbub.body.php
@@ -38,10 +38,16 @@
                return false;
        }
 
+       public static function getPageURL( $title ) {
+               return $title->getCanonicalURL( array(
+                       'action' => 'raw'
+               ) );
+       }
+
        private static function insertLinkHeader( $page ) {
                global $wgRequest, $wgPubSubHubbubHubURL;
                $wgRequest->response()->header( "Link: <" . 
$wgPubSubHubbubHubURL . ">; rel=\"hub\", <"
-                       . $page->getTitle()->getFullURL() . "&action=raw>; 
rel=\"self\"", false );
+                       . self::getPageURL( $page->getTitle() ) . ">; 
rel=\"self\"", false );
        }
 
        public static function onRawPageViewBeforeOutput( $rawPage, $text ) {
diff --git a/PublishChangesJob.php b/PublishChangesJob.php
index e7bac26..68769c3 100644
--- a/PublishChangesJob.php
+++ b/PublishChangesJob.php
@@ -33,7 +33,7 @@
        public function run() {
                global $wgPubSubHubbubHubURL;
                $publisher = new Publisher( $wgPubSubHubbubHubURL );
-               if ( $publisher->publish_update( $this->title->getFullURL() . 
"&action=raw" ) ) {
+               if ( $publisher->publish_update( PubSubHubbub::getPageUrl( 
$this->title ) ) ) {
                        return true;
                } else {
                        //TODO: Trigger some error.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2ae968c0186c91dc9401c58840f13c1ab9882e8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PubSubHubbub
Gerrit-Branch: master
Gerrit-Owner: Nik <sebastian.brueck...@student.hpi.uni-potsdam.de>

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

Reply via email to