Foswiki on GitHub is open for business! Next release meeting: Monday September 15, 1300Z

Item10978: Select element created with select+values does not handle empty select string

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Engine    
If the select value of the select+values part is an empty string (perhaps because of a SEARCH), the select HTML element shows the value part.

With this data table:

Name Type Size Values Tooltip message Attributes
wordType select+values 1 ,=1,Two=2 Type of word  

You will get this select element:

Instead of
<option value="=1" class="foswikiOption">=1</option>

the option should be
<option value="1" class="foswikiOption"></option>

The parsing of the select+values is done in Form::Select, line 58. The current regex is:
if ( $val =~ /^(.*?[^\\])=(.*)$/ ) {
    $str = TAINT($1);

but I believe it should be
if ( $val =~ /^(.*[^\\])*=(.*)$/ ) {
    $str = TAINT($1) || '';

-- ArthurClemens - 17 Jul 2011

Updated unit test and committed.

-- ArthurClemens - 17 Jul 2011

 

ItemTemplate edit

Summary Select element created with select+values does not handle empty select string
ReportedBy ArthurClemens
Codebase 1.1.3, trunk
SVN Range
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor
Checkins Foswikirev:12178 Foswikirev:12179 Foswikirev:12180
TargetRelease patch
ReleasedIn 1.1.4
Topic revision: r5 - 17 Dec 2011, GeorgeClark
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License