cvs: pear /HTML_QuickForm/QuickForm element.php
| From: | Bertrand Mansion | Date: | Fri, 13 Dec 2002 23:16:36 +0000 |
| Subject: | cvs: pear /HTML_QuickForm/QuickForm element.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-7879@lists.php.net to get a copy of this message | ||
mansion Fri Dec 13 18:16:36 2002 EDT
Modified files:
/pear/HTML_QuickForm/QuickForm element.php
Log:
Fix bug spotted by Culley Harrelson. When using createElement, submitted values were not updated
in elements.
Index: pear/HTML_QuickForm/QuickForm/element.php
diff -u pear/HTML_QuickForm/QuickForm/element.php:1.14
pear/HTML_QuickForm/QuickForm/element.php:1.15
--- pear/HTML_QuickForm/QuickForm/element.php:1.14 Fri Oct 25 17:36:52 2002
+++ pear/HTML_QuickForm/QuickForm/element.php Fri Dec 13 18:16:35 2002
@@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
-// $Id: element.php,v 1.14 2002/10/25 21:36:52 jrust Exp $
+// $Id: element.php,v 1.15 2002/12/13 23:16:35 mansion Exp $
require_once('HTML/Common.php');
@@ -354,17 +354,9 @@
}
break;
case 'setDefault':
- // In form display, default value is always overidden by submitted value
- $elementName = $this->getName();
- if (isset($caller->_submitValues[$elementName])) {
- $value = $caller->_submitValues[$elementName];
- if (is_string($value) && get_magic_quotes_gpc() == 1) {
- $value = stripslashes($value);
- }
- } else {
- $value = $arg;
+ if (isset($arg)) {
+ $this->setValue($arg);
}
- $this->setValue($value);
break;
case 'setConstant':
// In form display, constant value overides submitted value
@@ -381,4 +373,4 @@
// }}}
} // end class HTML_QuickForm_element
-?>
+?>
\ No newline at end of file