Trailing slash missing in directory URL

Bug #1150831 reported by Aaron Wells
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Aaron Wells
1.5
Fix Released
Low
Aaron Wells
1.6
Fix Released
Low
Aaron Wells
1.7
Fix Released
Low
Aaron Wells

Bug Description

In https://mahara.org/interaction/forum/topic.php?id=5269 , a user reported that clicking the "Done" button after editing a portfolio page, caused the user to be sent to a non-https version of their site, interrupting their login session.

After a bit of troubleshooting, it turned out that the problem was caused in part, by the fact that in raw/templates/view/blocks.tpl, the form containing the "Done" button submits to the url "{$WWWROOT}/view", rather than "{$WWWROOT}/view/". (note the missing trailing slash)

With most web servers, if you try to access a directory, but leave the trailing slash off the end, you will be redirected to the same URL with a trailing slash. (See http://httpd.apache.org/docs/2.2/mod/mod_dir.html#directoryslash for documentation of this in Apache, for instance). Somehow, this was causing problems for this user.

Since this can cause problems for some users, and since the correct URL for a directory has a trailing slash on the end anyway, we should fix this so that our directory URLs have a trailing slash. At the least, it'll save on a little bit of web traffic, by avoiding a redirect.

This problem was noticed in /view/blocks.tpl, but it's possible it could occur in other templates as well.

Revision history for this message
Tony Box (box-3) wrote :

I found this issue present in all of the links associated with the "getting started" homepage information block that is visible, by default, on your dashboard page (see attached).

If you click any of the links, it does what Aaron reported above.

There could be other places this pops up as well, but this has been the most problematic area since a lot of new users end up clicking those links to try and navigate around.

Revision history for this message
Aaron Wells (u-aaronw) wrote :
Changed in mahara:
status: New → In Progress
importance: Undecided → Low
Revision history for this message
Aaron Wells (u-aaronw) wrote :

Hi Tony,

I've submitted a patch for this issue to https://reviews.mahara.org/2087 . Please give it a test, if you can.

Cheers,
Aaron

Aaron Wells (u-aaronw)
no longer affects: mahara/1.8
no longer affects: mahara/trunk
Revision history for this message
Tony Box (box-3) wrote :

Aaron,

Thanks so much for pushing this patch through! Awesome job!

-Tony

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Hi Tony,

Were you able to test it and see if it works?

Cheers,
Aaron

Revision history for this message
Tony Box (box-3) wrote :

Aaron,

It works great! Thanks again. I'm running the newest master branch of 1.8 - haven't found any issues.

Tony

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/2087
Committed: http://gitorious.org/mahara/mahara/commit/1c56a9224ed019acc7de43b4cfac0e202482acb2
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 1c56a9224ed019acc7de43b4cfac0e202482acb2
Author: Aaron Wells <email address hidden>
Date: Fri Apr 26 11:44:43 2013 +1200

Making links to directory index.php files more explicit

Bug #1150831: Some links to directory index.php files left off the
trailing slash,
i.e. "{$WWWROOT}/view". This caused unnecessary redirects and greater
potential for
errors in users' web server setups. While I was at it, for all links to
directories
other than $WWWROOT itself, I changed them to be explicitly links to
"index.php".

Also fixed the Windows-style line endings in homeinfo.tpl

Fix all implicit links

Change-Id: I87b285713e5cb1cfe785ceedd2702e5c2578058b

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Robert Lyon (robertl-9) wrote :

patch set for branch 1.7_STABLE
https://reviews.mahara.org/#/c/2299/

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2299
Committed: http://gitorious.org/mahara/mahara/commit/098822757368620c2ddd9b8737eea17cbda01fff
Submitter: Robert Lyon (<email address hidden>)
Branch: 1.7_STABLE

commit 098822757368620c2ddd9b8737eea17cbda01fff
Author: Aaron Wells <email address hidden>
Date: Fri Apr 26 11:44:43 2013 +1200

Making links to directory index.php files more explicit

Bug #1150831: Some links to directory index.php files left off the
trailing slash,
i.e. "{$WWWROOT}/view". This caused unnecessary redirects and greater
potential for
errors in users' web server setups. While I was at it, for all links to
directories
other than $WWWROOT itself, I changed them to be explicitly links to
"index.php".

Also fixed the Windows-style line endings in homeinfo.tpl

Fix all implicit links

Change-Id: I87b285713e5cb1cfe785ceedd2702e5c2578058b

Revision history for this message
Robert Lyon (robertl-9) wrote :

patch set for branch 1.6_STABLE
https://reviews.mahara.org/#/c/2307/1

Revision history for this message
Robert Lyon (robertl-9) wrote :

patch set for branch 1.5_STABLE
https://reviews.mahara.org/#/c/2308/1

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2307
Committed: http://gitorious.org/mahara/mahara/commit/9b440fecd05cd01ad76910cbc198bd8e92e75a78
Submitter: Robert Lyon (<email address hidden>)
Branch: 1.6_STABLE

commit 9b440fecd05cd01ad76910cbc198bd8e92e75a78
Author: Aaron Wells <email address hidden>
Date: Fri Apr 26 11:44:43 2013 +1200

Making links to directory index.php files more explicit

Bug #1150831: Some links to directory index.php files left off the
trailing slash,
i.e. "{$WWWROOT}/view". This caused unnecessary redirects and greater
potential for
errors in users' web server setups. While I was at it, for all links to
directories
other than $WWWROOT itself, I changed them to be explicitly links to
"index.php".

Also fixed the Windows-style line endings in homeinfo.tpl

Fix all implicit links

Change-Id: I82b2cb51d5af161e1b41c272178476e156991032

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2308
Committed: http://gitorious.org/mahara/mahara/commit/168db2f1eb9c1cf050b1a82e4d1b2f0dba55abb8
Submitter: Robert Lyon (<email address hidden>)
Branch: 1.5_STABLE

commit 168db2f1eb9c1cf050b1a82e4d1b2f0dba55abb8
Author: Aaron Wells <email address hidden>
Date: Fri Apr 26 11:44:43 2013 +1200

Making links to directory index.php files more explicit

Bug #1150831: Some links to directory index.php files left off the
trailing slash,
i.e. "{$WWWROOT}/view". This caused unnecessary redirects and greater
potential for
errors in users' web server setups. While I was at it, for all links to
directories
other than $WWWROOT itself, I changed them to be explicitly links to
"index.php".

Also fixed the Windows-style line endings in homeinfo.tpl

Fix all implicit links

Change-Id: Ic77094a4a48dc13ba63c37ad43b53767187e505d

Revision history for this message
shanen (shane-nuessler-canberra) wrote :

Hi all,
Thanks,
This bug just came to light on our 1.7 installation.

The URL for our installation is http://learnonline.canberra.edu.au/portfolio/view/
When clicking the DONE button the user is directed to http://portfolio.canberra.edu.au/view/

When I manually take the trailing slash off of http://learnonline.canberra.edu.au/portfolio/view/ the same behaviour is replicated.

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Hi Shane,

Did you get the problem after you updated to 1.7.2? Or are you still on 1.7.1?

Cheers
Kristina

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Hi Shane,

It sounds like you may have the wrong wwwroot value stored in your configuration.

1. Have you got a "$cfg->wwwroot" line in your config.php file? And if so, is it correct?
2. Run this query in your database: select value from config where field='wwwroot';. Make sure it's correct.

Cheers,
Aaron

Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 1.8rc1 → 1.8.0
Aaron Wells (u-aaronw)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.