Closed

Description
\Phalcon\Tag::setAutoescape(false);
echo \Phalcon\Tag::textField(array('name', 'value' => '&"')), PHP_EOL;
\Phalcon\Tag::setAutoescape(true);
echo \Phalcon\Tag::textField(array('name', 'value' => '&"')), PHP_EOL;
\Phalcon\Tag::setDefault('name', '&"');
\Phalcon\Tag::setAutoescape(false);
echo \Phalcon\Tag::textField(array('name')), PHP_EOL;
\Phalcon\Tag::setAutoescape(true);
echo \Phalcon\Tag::textField(array('name')), PHP_EOL;
produces
<input type="text" value="&"" name="name" id="name" />
<input type="text" value="&"" name="name" id="name" />
<input type="text" name="name" id="name" value="&"" />
<input type="text" name="name" id="name" value="&#x26;&#x22;" />
value is escaped due to the bug introduced in a462ba2
However, the real issue is that Phalcon\Tag::getValue() only escapes the value when it is set either by setDefault() or is present in $_POST; if the value was specified in $params array it is NOT escaped by getValue() regardless of _autoEscape.
In the second case I would expect to see
<input type="text" value="&amp;&quot;" name="name" id="name" />
Metadata
Metadata
Assignees
Labels
No labels