The function "get_mahara_install_subdirectory" doesn't correctly handle a URL with a missing trailing slash

Bug #1599404 reported by Aaron Wells on 2016-07-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Low
Unassigned
15.04
Low
Unassigned
15.10
Low
Unassigned
16.04
Low
Unassigned

Bug Description

One of the causes of Bug 1592236 was that get_mahara_install_subdirectory() doesn't correctly handle a wwwroot with a missing trailing slash. If you set your wwwroot to e.g. "http://www.example.com", it will return "www.example.com".

This rarely affects anything because fairly early in init.php we rectify $CFG->wwwroot to add the missing trailing slash if it's missing. But if we need to call it before that point it can cause subtle problems, so we may as well fix it.

Aaron Wells (u-aaronw) on 2016-07-06
description: updated
Aaron Wells (u-aaronw) on 2016-07-06
Changed in mahara:
status: New → Confirmed
importance: Undecided → Low
milestone: none → 16.10.0
Aaron Wells (u-aaronw) on 2016-07-06
Changed in mahara:
status: Confirmed → In Progress

Reviewed: https://reviews.mahara.org/6661
Committed: https://git.mahara.org/mahara/mahara/commit/3fa968a0162f84a137df2fa9b40f5436a4e1df21
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 3fa968a0162f84a137df2fa9b40f5436a4e1df21
Author: Aaron Wells <email address hidden>
Date: Wed Jul 6 20:27:41 2016 +1200

Bug 1599404: Better handling of wwwroot with no trailing slash

behatnotneeded: Hard to test with Behat. I've provided a phpunit
test instead.

Change-Id: Ie2cde2501a69db652f8fcefd8e622166492f824e

Robert Lyon (robertl-9) on 2016-07-07
Changed in mahara:
status: In Progress → Fix Committed
Mahara Bot (dev-mahara) wrote :

Patch for "15.10_STABLE" branch: https://reviews.mahara.org/6669

Mahara Bot (dev-mahara) wrote :

Patch for "15.04_STABLE" branch: https://reviews.mahara.org/6670

Reviewed: https://reviews.mahara.org/6668
Committed: https://git.mahara.org/mahara/mahara/commit/b2a0a4d2f5fc90a9c4556297b3d602ce55a24d81
Submitter: Robert Lyon (<email address hidden>)
Branch: 16.04_STABLE

commit b2a0a4d2f5fc90a9c4556297b3d602ce55a24d81
Author: Aaron Wells <email address hidden>
Date: Wed Jul 6 20:27:41 2016 +1200

Bug 1599404: Better handling of wwwroot with no trailing slash

behatnotneeded: Hard to test with Behat. I've provided a phpunit
test instead.

Change-Id: Ie2cde2501a69db652f8fcefd8e622166492f824e
(cherry picked from commit 3fa968a0162f84a137df2fa9b40f5436a4e1df21)

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/6669
Committed: https://git.mahara.org/mahara/mahara/commit/ecc8d0dbdf29363945b9a6030ae5715204adef09
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.10_STABLE

commit ecc8d0dbdf29363945b9a6030ae5715204adef09
Author: Aaron Wells <email address hidden>
Date: Wed Jul 6 20:27:41 2016 +1200

Bug 1599404: Better handling of wwwroot with no trailing slash

behatnotneeded: Hard to test with Behat. I've provided a phpunit
test instead.

Change-Id: Ie2cde2501a69db652f8fcefd8e622166492f824e
(cherry picked from commit 3fa968a0162f84a137df2fa9b40f5436a4e1df21)

Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/6670
Committed: https://git.mahara.org/mahara/mahara/commit/23b0e15ca24f879af1bda1c5ec2fbd979c57bfab
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.04_STABLE

commit 23b0e15ca24f879af1bda1c5ec2fbd979c57bfab
Author: Aaron Wells <email address hidden>
Date: Wed Jul 6 20:27:41 2016 +1200

Bug 1599404: Better handling of wwwroot with no trailing slash

behatnotneeded: Hard to test with Behat. I've provided a phpunit
test instead.

Change-Id: Ie2cde2501a69db652f8fcefd8e622166492f824e
(cherry picked from commit 3fa968a0162f84a137df2fa9b40f5436a4e1df21)

Robert Lyon (robertl-9) on 2016-10-21
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers