[html-formfu] more secure param methods

Carl Franks fireartist at gmail.com
Thu Dec 20 23:20:49 GMT 2007


After following the recent discussion on the Catalyst mailing list,
I've added some new form methods.
The main reason is that the return value of param() can be hard to
figure out and can be dangerous if used in list context and multiple
values were unexpectedly submitted.
HTML-FormFu-Model-DBIC has been updated to use these new methods for
more predictable results, and I recommend you generally use these in
future, in preference to param().

    $form->param_value();
always returns a single value.
if multiple values are submitted, it returns the first.

    $form->param_array();
always returns an arrayref

    $form->param_list();
always returns a list

Cheers,
Carl



More information about the HTML-FormFu mailing list