You are here: Foswiki>Tasks Web>Item10978 (17 Dec 2011, GeorgeClark)Edit Attach

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

pencil
Priority: Normal
Current State: Closed
Released In: 1.1.4
Target Release: patch
Applies To: Engine
Component:
Branches:
Reported By: ArthurClemens
Waiting For:
Last Change By: GeorgeClark
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 distro:6216dd2bf871 distro:1b523f258e51 distro:589adc6b7c7d
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 Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy