Hello, I found a bug in sfWidgetFormInputFileEditable class. If we set
is_image to true. When there are no image uploaded, the render
generates an empty img tag :
<img />
W3c doesn't like this and find 2 errors. no src and no alt.
The proble is in the function getFileAsTag() :
protected function getFileAsTag($attributes)
{
if ($this->getOption('is_image'))
{
return false !== $this->getOption('file_src') ? $this-
>renderTag('img', array_merge(array('src' => $this-
>getOption('file_src')), $attributes)) : '';
}
else
{
return $this->getOption('file_src');
}
}
The function $this->getOption('file_src') doesn't return false when
there are no images. It returns 'null'. The test "!== false" returns
true and that creates an empty img tag.
To fix the bug, "false" has to be replaced by "null". (Or "!==" by "!
=" but that is less strict...)
Sorry for my english. I hope I helped.
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en