Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.9
-
Component/s: Authentication
-
Labels:None
-
Affected Branches:MOODLE_19_STABLE
-
Fixed Branches:MOODLE_18_STABLE, MOODLE_19_STABLE
Description
To reproduce...
1. Upload an image to a course's file area and copy the files's url
2. Place an img tag link to the image on the site front page
3. Confirm that the image is not displayed when you are logged out (at least)
4. Log in normally, you are sent to the image (in the course) - which will not be what a user expected.
What's happening is that the img tag calls file.php, which calles require_login() which in turn goes to the login page - except you see none of this as it's an image. Unfortunately, $SESSION->wantsurl has been set to the location of the image. When you next log in (properly) it picks up the wantsurl setting and sends you to that location immediately after login.
Of course, you shouldn't have that img there in the first place, but I spent days diagnosing this on a customer's site.
Attachments
Issue Links
| This issue has a clone: | ||||
| MDL-14235 | On logging in an image appeary instead of the moodle page. always works correctly the second try. |
|
|
|
| This issue will help resolve: | ||||
| MDL-14235 | On logging in an image appeary instead of the moodle page. always works correctly the second try. |
|
|
|
| This issue has been marked as being related by: | ||||
| MDL-16303 | Login redirect fails when the URL is a direct link to a Moodle hosted file |
|
|
|
Thanks for research, Howard. In fact we had this reported since some days ago at
MDL-14235... I'm going to see if we can leave file.php out from setting $SESSION->wantsurl in some way...Ciao
MDL-14235... I'm going to see if we can leave file.php out from setting $SESSION->wantsurl in some way... Ciao