zendframework / zend-form

Form component from Zend Framework
BSD 3-Clause "New" or "Revised" License
69 stars 87 forks source link

Troublesome attribute value gets cleared silently. #236

Open bitwombat opened 4 years ago

bitwombat commented 4 years ago

This code in AbstractHelper.php has the effect of silently failing:

        try {
            $escapedAttribute = $escapeAttr($value);
            $strings[] = sprintf('%s="%s"', $escape($key), $escapedAttribute);
        } catch (EscaperException $x) {
            // If an escaper exception happens, escape only the key, and use a blank value.
            $strings[] = sprintf('%s=""', $escape($key));
        }

Some problem with my attribute value was resulting in an exception and thus a blank value, as intended by the above code. I would have much preferred seeing the exception, instead of having to trace it down to this bit of code.

weierophinney commented 4 years ago

This repository has been closed and moved to laminas/laminas-form; a new issue has been opened at https://github.com/laminas/laminas-form/issues/1.