Alexander.lehmann has submitted this change and it was merged.
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(-)
Approvals:
Nik: Checked; Looks good to me, but someone else must approve
Alexander.lehmann: Verified; Looks good to me, approved
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: merged
Gerrit-Change-Id: Ia2ae968c0186c91dc9401c58840f13c1ab9882e8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PubSubHubbub
Gerrit-Branch: master
Gerrit-Owner: Nik <[email protected]>
Gerrit-Reviewer: Alexander.lehmann
<[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Nik <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits