From: nicolasconnault Date: Mon, 27 Jul 2009 12:02:39 +0000 (+0000) Subject: MDL-19756 Fixed incorrectly thrown exception in output->confirm() X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=cd5184a2786b9593c0dd26a4a7b9dcc055c48abf;p=moodle.git MDL-19756 Fixed incorrectly thrown exception in output->confirm() --- diff --git a/lib/outputlib.php b/lib/outputlib.php index c098cd9a26..16335feaee 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -2402,14 +2402,16 @@ class moodle_core_renderer extends moodle_renderer_base { $continueform = new html_form(); $continueform->url = new moodle_url($continue); $continue = $continueform; - } else { - throw new coding_exception('The 2nd and 3rd params to $OUTPUT->confirm must be either a URL (string/moodle_url) or a html_form object.'); + } else if (!is_object($continue)) { + throw new coding_exception('The 2nd param to $OUTPUT->confirm must be either a URL (string/moodle_url) or a html_form object.'); } if (!($cancel instanceof html_form) && !is_object($cancel)) { $cancelform = new html_form(); $cancelform->url = new moodle_url($cancel); $cancel = $cancelform; + } else if (!is_object($cancel)) { + throw new coding_exception('The 3rd param to $OUTPUT->confirm must be either a URL (string/moodle_url) or a html_form object.'); } if (empty($continue->button->label)) {