Issues

ZF-9247: DtDdWrapper change   to  

Issue Type: Sub-task Created: 2010-02-23T20:58:51.000+0000 Last Updated: 2010-04-05T09:33:28.000+0000 Status: Closed Fix version(s): Reporter: Jack Underwood (inarus) Assignee: Christian Albrecht (alab) Tags: - Zend_Form

Related issues: Attachments:

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

Posted by Christian Albrecht (alab) on 2010-04-05T05:49:44.000+0000

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

beside DtDdWrapper nbsp is used in Decorator_Label as well.

<pre class="highlight">
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 . '';
     }
 }

Posted by Christian Albrecht (alab) on 2010-04-05T06:14:06.000+0000

Added a patch so changing the Issue Type to Patch.

Posted by Christian Albrecht (alab) on 2010-04-05T09:33:27.000+0000

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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts