From 9610b8d444d135ad2ab1a1c5bd7d6ab69a1b2c36 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Mon, 3 May 2010 09:10:50 +0000 Subject: [PATCH] HTMLForm: Throw exceptions in some circumstances --- includes/HTMLForm.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index ba4720ee07..636e0d0e4c 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -191,6 +191,14 @@ class HTMLForm { * @return Bool whether submission was successful. */ function show() { + // Check if we have the info we need + if ( ! $this->mTitle ) { + throw new MWException( "You must call setTitle() on an HTMLForm" ); + } + if ( ! $this->mSubmitCallback ) { + throw new MWException( "You must set a submission callback" ); + } + $html = ''; self::addJS(); -- 2.20.1