MDL-64615 tool_mobile: Do not modify custom download URLs
authorJuan Leyva <juanleyvadelgado@gmail.com>
Thu, 7 Feb 2019 12:27:29 +0000 (13:27 +0100)
committerJuan Leyva <juanleyvadelgado@gmail.com>
Wed, 13 Mar 2019 16:10:02 +0000 (17:10 +0100)
admin/tool/mobile/lib.php

index 0ecfeff..5646510 100644 (file)
@@ -66,6 +66,12 @@ function tool_mobile_create_app_download_url() {
     }
 
     $downloadurl = new moodle_url($mobilesettings->setuplink);
+
+    // Do not update the URL if it is a custom one (we may break it completely).
+    if ($mobilesettings->setuplink != 'https://download.moodle.org/mobile') {
+        return $downloadurl;
+    }
+
     $downloadurl->param('version', $CFG->version);
     $downloadurl->param('lang', current_language());