Development

#3908 (sfWidget renders non-valid element when in not-xhtml mode)

You must first sign up to be able to contribute.

Ticket #3908 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

sfWidget renders non-valid element when in not-xhtml mode

Reported by: rmatters Assigned to: fabien
Priority: minor Milestone: 1.1.1
Component: other Version: 1.1.0
Keywords: Cc:
Qualification: Unreviewed

Description

The sfWdiget class doesn't render the input tag correctly when not in xhtml mode. The input tag is the only form element in html4 which does not have an closing tag ( <input></input> ), while others do ( eg select, textarea ). Because sfWidget is not loaded by the autoload cache it is impossible to copy this file and fix it because an update to my symfony copy will revert my fix. :(

sfWidget, line 278:

return sprintf('<%s%s%s', $tag, $this->attributesToHtml($attributes), self::$xhtml ? ' />' : sprintf('></%s>', $tag));


The fix is:

return sprintf('<%s%s%s', $tag, $this->attributesToHtml($attributes), self::$xhtml ? ' />' : ( $tag != 'input' ? sprintf('></%s>', $tag) : '>' ));


Thanks

Change History

07/12/08 09:04:15 changed by Carl.Vondrick

  • status changed from new to closed.
  • resolution set to fixed.

(In [10235]) 1.1: fixed sfWidgetForm to produce a valid <input> tag in HTML mode (closes #3908)

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.