roeya
Posts: 181
|
Posted: 04/02/2006, 4:44 AM |
|
In CCS 3.0.3.1:
If you submit multiple value field such as checkbox list there is an error in CCConvertEncodingHash that cause it to erase the values:
When the fucntion checks if fields are ARRAY or HASH using the following code:
if (ref $val =~ /ARRAY/) {
CCConvertEncodingArray($val, $from, $to);
} elsif (ref $val =~ /HASH/) {
CCConvertEncodingHash($val, $from, $to);
} else {
$val = CCConvertEncoding($val, $from, $to);
}
There is a bug in evaluating - instead of evaluting ref $val and then checking it against the RE (/ARRAY/) first it is checked against the /ARRAY/ and the result is evaluated by ref which will be always ''
You should change the ref to ref() in the code to:
if (ref ($val) =~ /ARRAY/) {
CCConvertEncodingArray($val, $from, $to);
} elsif (ref ($val) =~ /HASH/) {
CCConvertEncodingHash($val, $from, $to);
} else {
$val = CCConvertEncoding($val, $from, $to);
}
I checked this with perl 5.8.7 from activestate
I submited the bug to support, this is just to let you know
_________________
http://www.infoneto.com/ |
 |
 |
roeya
Posts: 181
|
Posted: 04/02/2006, 6:33 AM |
|
A way around the bug:
my @reasons = $cgi->param("reject_reasons");
where "reject_reasons" is the field name
what is returned is an array with the values.
However the values are not encoded in the right encoding unless you use only 7bit ASCII code
_________________
http://www.infoneto.com/ |
 |
 |
|