Bug #5716 [NEW]: Input fields should set maximum length to prevent unexpected input truncation
| From: | dbs at php dot net | Date: | Tue, 18 Oct 2005 16:29:22 +0000 |
| Subject: | Bug #5716 [NEW]: Input fields should set maximum length to prevent unexpected input truncation | ||
| Groups: | php.pear.webmaster | ||
| Request: | Send a blank email to pear-webmaster+get-4510@lists.php.net to get a copy of this message | ||
From: dbs at php dot net
Operating system:
PHP version: Irrelevant
Package: Web Site
Bug Type: Bug
Bug description: Input fields should set maximum length to prevent unexpected input truncation
Description:
------------
The input fields for the "New Package" form
(peclweb/public_html/package-new.php) should set the maximum length of the
field. In HTML::Form this is the fourth optional parameter for the
HTML::Form->returnText() function.
Reproduce code:
---------------
Index: package-new.php
===================================================================
RCS file: /repository/peclweb/public_html/package-new.php,v
retrieving revision 1.24
diff -u -r1.24 package-new.php
--- package-new.php 9 Oct 2005 00:28:00 -0000 1.24
+++ package-new.php 18 Oct 2005 16:23:36 -0000
@@ -131,7 +131,7 @@
$bb = new BorderBox("Register package", "100%", "", 2, true);
$bb->horizHeadRow("Package Name", $form->returnText("name",
get("name"), 20));
- $bb->horizHeadRow("License", $form->returnText("license",
get("license"), 20));
+ $bb->horizHeadRow("License", $form->returnText("license",
get("license"), 20, 20));
$cats = $form->returnSelect("category", $categories, get("category"),
1,
"--Select Category--");
$bb->horizHeadRow("Category", $cats);
Expected result:
----------------
Typical user will be unable to enter > 20 chars in the License text field,
preventing unexpected truncation of the input. Setting the maxlength
attribute of the text field will let users know how much text they have to
work with.
Actual result:
--------------
I found this problem when I added the PDO_IDS package with the license
"Apache License, Version 2.0", only to have the database silently truncate
the input to "Apache License, Ver". The same bug bit me when I added the
ibm_db2 license.
--
Edit bug report at http://pecl.php.net/bugs/bug.php?id=5716&edit=1
--