From: Max Semenik Date: Tue, 22 May 2012 15:09:52 +0000 (+0400) Subject: HTMLForm: throw a warning when no callback is set X-Git-Tag: 1.31.0-rc.0~23510^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=4d3620a08d8268da00f947100ad1ac212a6bec04;p=lhc%2Fweb%2Fwiklou.git HTMLForm: throw a warning when no callback is set Change-Id: Ied019afaf607c4b5967989fcb53945a116eeaed6 --- 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 );