Issues

ZF-9247: DtDdWrapper change   to  

Description

  is not a valid xml character reference, when combined with the lack of a DTD in XHTML5 this breaks.

Need to change it to use the equivalent Numerical Character Reference, this is  

Comments

// edit LOL This patch changes all   into   within Zend_Form and Zend_Form_UnitTests.

beside DtDdWrapper nbsp is used in Decorator_Label as well.


Index: tests/Zend/Form/SubFormTest.php
===================================================================
--- tests/Zend/Form/SubFormTest.php     (Revision 21740)
+++ tests/Zend/Form/SubFormTest.php     (Arbeitskopie)
@@ -130,7 +130,7 @@
         $form->addSubForm($subForm, 'foobar')
              ->setView(new Zend_View);
         $html = $form->render();
-        $this->assertContains(' ', $html);
+        $this->assertContains(' ', $html);
     }
 }
 
Index: tests/Zend/Form/DisplayGroupTest.php
===================================================================
--- tests/Zend/Form/DisplayGroupTest.php        (Revision 21740)
+++ tests/Zend/Form/DisplayGroupTest.php        (Arbeitskopie)
@@ -401,7 +401,7 @@
 
         $this->group->addElements(array($foo, $bar));
         $html = $this->group->render($this->getView());
-        $this->assertRegexp('#^]*> ]*>$#s', $html, $html);
+        $this->assertRegexp('#^]*>&\#160;]*>$#s', $html, $html);
         $this->assertContains('assertContains('"foo"', $html);
         $this->assertContains('"bar"', $html);
@@ -415,7 +415,7 @@
         $this->group->addElements(array($foo, $bar))
                     ->setView($this->getView());
         $html = $this->group->__toString();
-        $this->assertRegexp('#^]*> ]*>$#s', $html, $html);
+        $this->assertRegexp('#^]*>&\#160;]*>$#s', $html, $html);
         $this->assertContains('assertContains('"foo"', $html);
         $this->assertContains('"bar"', $html);
Index: tests/Zend/Form/Element/RadioTest.php
===================================================================
--- tests/Zend/Form/Element/RadioTest.php       (Revision 21740)
+++ tests/Zend/Form/Element/RadioTest.php       (Arbeitskopie)
@@ -168,7 +168,7 @@
                 'test' => 'Test',
             ));
         $html = $this->element->render($this->getView());
-        $this->assertRegexp('#]*> .*?assertRegexp('#]*>&\#160;.*?render();
 
-        $this->assertContains(' ', $html);
+        $this->assertContains(' ', $html);
         $this->assertContains('', $html);
     }
 
@@ -3773,7 +3773,7 @@
 
         $html = $form->render();
 
-        $this->assertContains(' ', $html);
+        $this->assertContains(' ', $html);
         $this->assertContains('', $html);
     }
 
Index: library/Zend/Form/Decorator/Label.php
===================================================================
--- library/Zend/Form/Decorator/Label.php       (Revision 21740)
+++ library/Zend/Form/Decorator/Label.php       (Arbeitskopie)
@@ -310,7 +310,7 @@
             $options['class'] = $class;
             $label = $view->formLabel($element->getFullyQualifiedName(), trim($label), $options);
         } else {
-            $label = ' ';
+            $label = ' ';
         }
 
         if (null !== $tag) {
Index: library/Zend/Form/Decorator/DtDdWrapper.php
===================================================================
--- library/Zend/Form/Decorator/DtDdWrapper.php (Revision 21740)
+++ library/Zend/Form/Decorator/DtDdWrapper.php (Arbeitskopie)
@@ -57,7 +57,7 @@
     {
         $elementName = $this->getElement()->getName();
 
-        return ' ' .
+        return ' ' .
                '' . $content . '';
     }
 }

Added a patch so changing the Issue Type to Patch.

See the parent Issue, there is a suggestion to replace the &nbsp with a html comment tag.