From: Andrew Garrett Date: Mon, 3 May 2010 09:10:50 +0000 (+0000) Subject: HTMLForm: Throw exceptions in some circumstances X-Git-Tag: 1.31.0-rc.0~36959 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=9610b8d444d135ad2ab1a1c5bd7d6ab69a1b2c36;p=lhc%2Fweb%2Fwiklou.git HTMLForm: Throw exceptions in some circumstances --- 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();