From 4d3620a08d8268da00f947100ad1ac212a6bec04 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Tue, 22 May 2012 19:09:52 +0400 Subject: [PATCH] HTMLForm: throw a warning when no callback is set Change-Id: Ied019afaf607c4b5967989fcb53945a116eeaed6 --- includes/HTMLForm.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index e56ca2ee6a..c14996541a 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -333,6 +333,9 @@ class HTMLForm extends ContextSource { } $callback = $this->mSubmitCallback; + if ( !is_callable( $callback ) ) { + throw new MWException( 'HTMLForm: no submit callback provided. Use setSubmitCallback() to set one.' ); + } $data = $this->filterDataForSubmit( $this->mFieldData ); -- 2.20.1