MDL-58285 tool_mobile: Web service generates incorrect fileurl on IIS
The tool_mobile_get_plugins_supporting_mobile generated an incorrect fileurl on IIS. The /mobile/filename.zip part was generated as \mobile\filename.zip, this failed the PARAM_URL check. This change stops the use of OS specific directory separators and uses the linux/web separator. PHP file functions recognise this properly.
This commit is contained in:
@@ -69,7 +69,7 @@ class api {
|
||||
);
|
||||
|
||||
// All the mobile packages must be under the plugin mobile directory.
|
||||
$package = $path . DIRECTORY_SEPARATOR . 'mobile' . DIRECTORY_SEPARATOR . $addonname . '.zip';
|
||||
$package = $path . '/mobile/' . $addonname . '.zip';
|
||||
if (file_exists($package)) {
|
||||
$plugininfo['fileurl'] = $CFG->wwwroot . '' . str_replace($CFG->dirroot, '', $package);
|
||||
$plugininfo['filehash'] = sha1_file($package);
|
||||
|
||||
Reference in New Issue
Block a user