Closed (fixed)
Project:
Forms (obsolete)
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Jul 2007 at 04:52 UTC
Updated:
22 Mar 2008 at 06:51 UTC
When a form specifies '#required' => TRUE a user can still enter blank information by way of spaces. This is bad as allowing spaces as titles, private message subject lines, etc, etc. brakes the links that these things should be accessed by.
Eg. a node title or private message subject is usually clickable, but if these entities are allowed to be entered as spaces they can no longer be clicked and opened.
So in addition to using the empty function one should trim and check that.
Patch for form.inc below:
532c532,534
< if ($elements['#required'] && empty($elements['#value']) && $elements['#value'] !== '0') {
---
> if ($elements['#required'] &&
> (empty($elements['#value']) || trim($elements['#value']) == '') &&
> $elements['#value'] !== '0') {
Comments
Comment #1
quicksketchForms and survey modules are no longer being maintained, use Webform module instead.
---Closing down issue queue of survey module---