-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
2.2.2
When using the grade reporting feature of IMS-LTI on a non-Apache server environment, there is an issue with the use of the getallheaders() function. When attmepting to use outcome functionality with the test tool provider located at http://www.imsglobal.org/developers/LTI/test/v1p1/tool.php
an error occurs in mod/lti/service.php.
According to http://us2.php.net/manual/en/function.getallheaders.php the getallheaders function, which service.php uses, is only supported on Apache.
A workaround was defining the function if it doesn't already exist.
Steps to reproduce:
- Install Moodle on IIS (though any non-Apache server would also likely cause this)
- Create a new external tool activity linking to http://www.imsglobal.org/developers/LTI/test/v1p1/tool.php
- Save and display the activity
- Navigate to the LIS/LTI Outcome Service
- Attempt any of the functions - service.php will error out (or no result is returned)
Potential Solution/Workaround:
Added the following to servicelib.php (solution found in comments on php documentation):
if (!function_exists('getallheaders'))
|
{
|
function getallheaders()
|
{
|
foreach ($_SERVER as $name => $value)
|
{
|
if (substr($name, 0, 5) == 'HTTP_')
|
{
|
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
|
}
|
}
|
return $headers;
|
}
|
}
|
- is duplicated by
-
MDL-40005 Service.php cannot read the Authorization header when PHP is run as FCGI
-
- Closed
-