Adamw has uploaded a new change for review.
https://gerrit.wikimedia.org/r/109036
Change subject: Fix protocol-relative URL for enrolling students
......................................................................
Fix protocol-relative URL for enrolling students
Change-Id: I3f53a511a6c7639f6275e6ec278fe3112fa4afe5
---
M includes/actions/ViewCourseAction.php
1 file changed, 6 insertions(+), 2 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EducationProgram
refs/changes/36/109036/1
diff --git a/includes/actions/ViewCourseAction.php
b/includes/actions/ViewCourseAction.php
index 84ad239..0e6975d 100644
--- a/includes/actions/ViewCourseAction.php
+++ b/includes/actions/ViewCourseAction.php
@@ -420,9 +420,13 @@
);
// URL for enroll link (not a live link, but rather text for
pasting)
+
+ $token = $course->getField( 'token' );
+ $tokenSuffix = $token === '' ? '' : '/' . $token;
+
$enrollLink = SpecialPage::getTitleFor(
- 'Enroll', $course->getField( 'title' ) . '/' .
- $course->getField( 'token' ) )->getFullUrl();
+ 'Enroll', $course->getField( 'title' ) . $tokenSuffix )
+ ->getFullUrl( '', false, PROTO_CANONICAL );
$html .= Html::element(
'p',
--
To view, visit https://gerrit.wikimedia.org/r/109036
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f53a511a6c7639f6275e6ec278fe3112fa4afe5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EducationProgram
Gerrit-Branch: wmf/1.23wmf11
Gerrit-Owner: Adamw <[email protected]>
Gerrit-Reviewer: AndyRussG <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits