Summary: input markup does not accept array operator '[]' characters as part of name
Created: 2009-08-04 15:25
Status: Closed (added for 2.2.5)
Category: Bug
From: HansB
Priority: 5
Version: 2.2

Description: Since version 2.2 I think characters '[]' are disallowed in name values of input markup. This change cripples markup relying on such array operator characters. Input markup with names like name=chk[] was passed on in earlier versions, allowing php to construct an array. Most used with checkboxes and radio buttons.

This change did cripple recipe StarRater, and possibly applications of Fox.

I ask to make it possible again to use markup like

(:input checkbox chk[] value1:)
(:input checkbox chk[] value2:)
(:input checkbox chk[] value3:)

Can the [] characters be included in line 101 forms.php, i.e.

$opt['name'] = preg_replace('/[^-A-Za-z0-9:_.\[\]]+/', '_', $opt['name']);

See more info

This line follows the standard for Basic HTML data types: ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). (W3C Reference) so it is not a bug. I think however that we could add an exception. --Petko August 05, 2009, at 07:20 AM