PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_QuickForm » Bug #9752

formNames with period aren't handled properly when trackSubmit is enabled

Details

Submitted2007-01-06 00:57 UTC
Fromrob at endertechnology dot com
StatusWont fix
PackageHTML_QuickForm
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2007-01-06 00:57 UTC] rob at endertechnology dot com

Description:
------------
Forms passed with a formName with a period ("News.data") aren't properly handled when trackSubmit is enabled.

PHP converts periods to underscores for HTML input names.

Thus:
"_qf__News.data" becomes "_qf__News_data" which isn't matched in the HTML_QuickForm constructor.

The current if() is:

if (!$trackSubmit || isset($_REQUEST['_qf__' . $formName]))

I changed it to:
isset($_REQUEST['_qf__' . str_replace('.', '_', $formName)])

And the forms now work properly.

I don't believe this will break anything.

[2007-01-06 10:29 UTC] mansion at php dot net

If PHP does so by itself, it must be the expected behavior. There is no reason to change the expected behavior. I suggest you use another form name or perform the str_replace() in your own code.

[2007-01-06 20:49 UTC] rob at endertechnology dot com

I'm indifferent if this is changed/fixed or not. However, I don't fully understand the reason because I'm working with the package and not with PHP's GET/POST/REQUEST variables.

A note in the documentation that quickform doesn't handle periods in form/element names should, at the very least, be the outcome of this report.

Thanks