From 2c60b807955e95cd7d37ddf40f079cc48ef59113 Mon Sep 17 00:00:00 2001 From: Neill Magill Date: Thu, 16 Mar 2017 12:08:36 +0000 Subject: [PATCH] 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. --- admin/tool/mobile/classes/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/tool/mobile/classes/api.php b/admin/tool/mobile/classes/api.php index 1dbe965f915..6f6cb71fe97 100644 --- a/admin/tool/mobile/classes/api.php +++ b/admin/tool/mobile/classes/api.php @@ -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);