This might be a fix, don't know if it is fast enough for you, it works for me, under windows:

   /**
    * Retrieve a registered decorator
    *
    * @param  string $name
    * @return false|Zend_Form_Decorator_Abstract
    */
   public function getDecorator($name)
   {
       if (!isset($this->_decorators[$name])) {
           $decorators = array_keys($this->_decorators);
           $len = strlen($name);
           foreach ($decorators as $decorator) {
/*if (0 === @substr_compare($decorator, $name, -$len, $len, true)) {
                   return $this->_decorators[$decorator];
               }*/
               $escaped_name = preg_quote($name);
               if(preg_match("/.*$escaped_name$/i",$decorator)){
                   return $this->_decorators[$decorator];
               }
           }
           return false;
       }

       return $this->_decorators[$name];
   }

Matthew Weier O'Phinney schreef:
-- Bart McLeod <[EMAIL PROTECTED]> wrote
(on Monday, 16 June 2008, 02:43 AM -0700):
I use quite a lot of decorators on form elements an I apply them at various
points at runtime, depending on how exactly the form should display,
depending on its state.

I get this warning (serveral times): Warning: substr_compare() [function.substr-compare]: The length cannot
exceed initial string length in
D:\ZendFramework\library\Zend\Form\Element.php on line 1553

This is an issue with Windows only, and we've been trying to find a fix
since just before the 1.5.0 release (when we first discovered it).
Unfortunately, I don't have a windows machine against which to test, so
I can't work on the issue.

Anybody with a Windows machine who is using Zend_Form who wants to look
into it and send in a patch?

Reply via email to