jenkins-bot has submitted this change and it was merged.

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

Approvals:
  Adamw: Looks good to me, approved
  jenkins-bot: Verified



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/108290
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3f53a511a6c7639f6275e6ec278fe3112fa4afe5
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/EducationProgram
Gerrit-Branch: master
Gerrit-Owner: AndyRussG <[email protected]>
Gerrit-Reviewer: Adamw <[email protected]>
Gerrit-Reviewer: AndyRussG <[email protected]>
Gerrit-Reviewer: Ragesoss <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to