Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.7, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6
-
Fix Version/s: None
-
Component/s: Files API
-
Labels:None
-
Environment:All versions of Firefox, Safari Mac
-
Affected Branches:MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
Description
Firefox's WMV plugin can not load .wmv files via moodle's file.php.
I've discovered an ugly but working solution to this problem. As you stated in MDL-6140, the problem has to do with cookies. Once the Media Player plug in loads in Firefox the moodle file.php can't find the cookies it's looking for to verify it's session.
If you pass the PHPSESSID and the session_test key in the url, you can reset the cookies from file.php and everything will load just fine. I know this isn't the most secure or elegant solution but it solves the problem. A better solution might be to generate a temporary key that can be passed in the URL to verify the session once, then be discarded.
Here are my code changes.
In /mod/resource/type/file/resource.class.php
Around line 310 I've changed: $relativeurl = "/file.php/{$course->id}/{$resource->reference}";
TO: $relativeurl = "/file.php/PHPSESSID/".session_id()."/sstest/".$_SESSION['SESSION']>session_test."/{$course>id}/{$resource->reference}";
Around line 316 I've changed: $relativeurl = "/file.php?file=/{$course->id}/{$resource->reference}";
TO: $relativeurl = "/file.php?PHPSESSID=".session_id()."&sstest=".$_SESSION['SESSION']>session_test."&file=/{$course>id}/{$resource->reference}";
In /file.php I've added the following lines of code around line 40:
if($args[0] == 'PHPSESSID'){
setcookie('MoodleSession', $args[1]);
$pathname = str_replace("/PHPSESSID/".$args[1], "", $pathname);
$args = array_splice($args, 2);
}
if($args[0] == 'sstest'){
setcookie('MoodleSessionTest', $args[1]);
$pathname = str_replace("/sstest/".$args[1], "", $pathname);
$args = array_splice($args, 2);
}
Like I said, this isn't the best solution, but it is a solution... and if it leads to a better solution that's great!
Attachments
Issue Links
| This issue blocks: | ||||
| MDL-6140 | windows media video *.wmv does not open in FireFox |
|
|
|
Same issue I believe