Merge branch 'MDL-43902-master' of git://github.com/FMCorz/moodle
[moodle.git] / lib / outputcomponents.php
index ececc4a..04aeba4 100644 (file)
@@ -2853,7 +2853,13 @@ class custom_menu extends custom_menu_item {
                             $itemtitle = $itemtext;
                             break;
                         case 1:
-                            $itemurl = new moodle_url($setting);
+                            try {
+                                $itemurl = new moodle_url($setting);
+                            } catch (moodle_exception $exception) {
+                                // We're not actually worried about this, we don't want to mess up the display
+                                // just for a wrongly entered URL.
+                                $itemurl = null;
+                            }
                             break;
                         case 2:
                             $itemtitle = $setting;