From bb6d40dcf2a7c8fde5be24560ee47fd566d2b201 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 18 Aug 2015 20:42:11 +0200 Subject: Form: fixed class checks --- inc/Form/Form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/Form/Form.php b/inc/Form/Form.php index 73b5b9cb3..7eaa53041 100644 --- a/inc/Form/Form.php +++ b/inc/Form/Form.php @@ -140,7 +140,7 @@ class Form extends Element { * @return Element */ public function addElement(Element $element, $pos = -1) { - if(is_a($element, '\dokuwiki\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form'); + if(is_a($element, '\dokuwiki\Form\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form'); if($pos < 0) { $this->elements[] = $element; } else { @@ -156,7 +156,7 @@ class Form extends Element { * @param $pos 0-based position of the element to replace */ public function replaceElement(Element $element, $pos) { - if(is_a($element, '\dokuwiki\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form'); + if(is_a($element, '\dokuwiki\Form\Form')) throw new \InvalidArgumentException('You can\'t add a form to a form'); array_splice($this->elements, $pos, 1, array($element)); } -- cgit v1.2.3