← Back to team overview

anewt-developers team mailing list archive

Re: [Branch ~sander-sinaasappel/anewt/anewt.new.cxs] Rev 1474: [form] Added missing assertion to AnewtFormControlChoice

 

Hey,

Read below the patch:

2009-07-20 klockan 22:47 skrev noreply@xxxxxxxxxxxxx:
> ------------------------------------------------------------
> revno: 1474
> committer: Sander van Schouwenburg <sander@xxxxxxxxxxxxx>
> branch nick: anewt.new.cxs
> timestamp: Mon 2009-07-20 17:54:18 +0200
> message:
>   [form] Added missing assertion to AnewtFormControlChoice
>   
>   AnewtFormControlChoice::add_option_value_label now asserts the value is a
>   string.
>   
>   
>   (from anewt.new.svn:83)
> modified:
>   form/controls/choice.lib.php
> 
> === modified file 'form/controls/choice.lib.php'
> --- form/controls/choice.lib.php	2009-07-20 15:53:44 +0000
> +++ form/controls/choice.lib.php	2009-07-20 15:54:18 +0000
> @@ -376,6 +376,7 @@
>  	 */
>  	function add_option_value_label($value, $label)
>  	{
> +		assert('is_string($value)');
>  		$option = new AnewtFormOption($value, $label);
>  		$this->add_option($option);
>  	}


Why not check this in AnewtFormOption::__construct() instead?

    — Wouter

Attachment: signature.asc
Description: Digital signature