From cd5184a2786b9593c0dd26a4a7b9dcc055c48abf Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Mon, 27 Jul 2009 12:02:39 +0000 Subject: [PATCH] MDL-19756 Fixed incorrectly thrown exception in output->confirm() --- lib/outputlib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)) { -- 2.39.5