cvs: pear /HTML_QuickForm QuickForm.php
| From: | Jason Rust | Date: | Fri, 19 Jul 2002 21:54:22 +0000 |
| Subject: | cvs: pear /HTML_QuickForm QuickForm.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5203@lists.php.net to get a copy of this message | ||
jrust Fri Jul 19 17:54:22 2002 EDT
Modified files:
/pear/HTML_QuickForm QuickForm.php
Log:
Throw an error in renderElement() if the element doesn't exist.
Index: pear/HTML_QuickForm/QuickForm.php
diff -u pear/HTML_QuickForm/QuickForm.php:1.31 pear/HTML_QuickForm/QuickForm.php:1.32
--- pear/HTML_QuickForm/QuickForm.php:1.31 Thu Jul 18 17:10:28 2002
+++ pear/HTML_QuickForm/QuickForm.php Fri Jul 19 17:54:22 2002
@@ -17,7 +17,7 @@
// | Bertrand Mansion <bmansion@mamasam.com> |
// +----------------------------------------------------------------------+
//
-// $Id: QuickForm.php,v 1.31 2002/07/18 21:10:28 jrust Exp $
+// $Id: QuickForm.php,v 1.32 2002/07/19 21:54:22 jrust Exp $
require_once("PEAR.php");
require_once("HTML/Common.php");
@@ -732,6 +732,9 @@
function renderElement($elementName, $remove = false, $removeRules = false)
{
$element = $this->getElement($elementName);
+ if (is_null($element)) {
+ return PEAR::raiseError(null, QUICKFORM_NONEXIST_ELEMENT, null, E_USER_WARNING,
"Element '$elementName' does not exist in HTML_QuickForm::renderElement()",
'HTML_QuickForm_Error', true);
+ }
$html = $this->_buildElement($element);
if ($remove) {
$this->removeElement($elementName, $removeRules);