cvs: pear /HTML_QuickForm/QuickForm group.php
| From: | Bertrand Mansion | Date: | Fri, 14 Jun 2002 13:11:10 +0000 |
| Subject: | cvs: pear /HTML_QuickForm/QuickForm group.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4613@lists.php.net to get a copy of this message | ||
mansion Fri Jun 14 09:11:10 2002 EDT
Modified files:
/pear/HTML_QuickForm/QuickForm group.php
Log:
Same magic_quotes handling as in element.php when setting the submitted values.
Index: pear/HTML_QuickForm/QuickForm/group.php
diff -u pear/HTML_QuickForm/QuickForm/group.php:1.4 pear/HTML_QuickForm/QuickForm/group.php:1.5
--- pear/HTML_QuickForm/QuickForm/group.php:1.4 Thu May 16 08:37:41 2002
+++ pear/HTML_QuickForm/QuickForm/group.php Fri Jun 14 09:11:10 2002
@@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
-// $Id: group.php,v 1.4 2002/05/16 12:37:41 mansion Exp $
+// $Id: group.php,v 1.5 2002/06/14 13:11:10 mansion Exp $
require_once("HTML/QuickForm/element.php");
@@ -48,7 +48,7 @@
* @since 1.0
* @access private
*/
- var $_name = "";
+ var $_name = '';
/**
* Array of grouped elements
@@ -56,7 +56,7 @@
* @since 1.0
* @access private
*/
- var $_elements = "";
+ var $_elements = '';
/**
* String to seperator elements
@@ -64,7 +64,7 @@
* @since 1.1
* @access private
*/
- var $_seperator = "";
+ var $_seperator = '';
// }}}
// {{{ constructor
@@ -91,8 +91,11 @@
}
$vars = array_merge($GLOBALS['HTTP_GET_VARS'],
$GLOBALS['HTTP_POST_VARS']);
if (isset($vars[$this->getName()])) {
- $submitValue = (is_string($vars[$this->getName()])) ?
- stripslashes($vars[$this->getName()]) : $vars[$this->getName()];
+ if (is_string($vars[$this->getName()]) && get_magic_quotes_gpc() == 1) {
+ $submitValue = stripslashes($vars[$this->getName()]);
+ } else {
+ $submitValue = $vars[$this->getName()];
+ }
$this->setValue($submitValue);
}
$this->_type = 'group';