When inserting an image slot, it is possible to acknowledge a legend, url, src, width, height.
Legend and url are not img tag attributes and when building a tag in sfSimpleCMSSlotImage->getSlotValue($slot), they are unset.
The issue is that if you did not insert any value for legend and/or url, their value is null, isset($params['url']) and isset($params['legend']) will return false, and therefore those are not unset.
That causes XHTML invalid code.
A workaround is to set legend and url params only if they were filled by user :
in sfSimpleCMSPlugin/lib/slotType/sfSimpleCMSSlotImage.class.php, replace your current
public function getSlotValueFromRequest($request)
{
...
}
by
public function getSlotValueFromRequest($request)
{
$params = array();
$params['src'] = $request->getParameter('src');
$params['width'] = $request->getParameter('width');
$params['height'] = $request->getParameter('height');
'''if($request->getParameter('legend'))'''
{
$params['legend'] = $request->getParameter('legend');
}
'''if($request->getParameter('url'))'''
{
$params['url'] = $request->getParameter('url');
}
return sfYaml::dump($params);
}