Development

#3299 (FCK editor & admin generator: Default input can't be rendered (not raw data))

You must first sign up to be able to contribute.

Ticket #3299 (new defect)

Opened 3 months ago

FCK editor & admin generator: Default input can't be rendered (not raw data)

Reported by: bicpi Assigned to: fabien
Priority: major Milestone:
Component: generator Version: 1.0.12
Keywords: fck, fckeditor, generator Cc:
Qualification: Unreviewed

Description

Hi, I've set up a backend using the admin generator. One table field contains HTML and should be edited using the fckeditor, which works fine everywhere in the frontend.

But in the backend there's an escaping issue (I'm using "both, ESC_ENTITIES"). The HTML is loaded into the editor, but it seems to be escaped before (which is of course correct for all the other input fields), so I only see the HTML in the design view of FCK, it can't be rendered by the editor.

I did a lot of search on the web/symfony page and I only found an old thread in the forum "solving" this issue here.

But the fix proposed changes the symfony source:

Old:

function object_textarea_tag($object, $method, $options = array(), $default_value = null)
{
  $options = _parse_attributes($options);

  $value = _get_object_value($object, $method, $default_value);

  return textarea_tag(_convert_method_to_name($method, $options), $value, $options);
}

New:

function object_textarea_tag($object, $method, $options = array(), $default_value = null)
{
  $options = _parse_attributes($options);

  $value = _get_object_value($object, $method, $default_value, ESC_RAW);

  return textarea_tag(_convert_method_to_name($method, $options), $value, $options);
}

So adding the last parameter ESC_RAW to _get_object_value() solves the problem. I can't figure out an alternative solution for that issue, but it hasn't found its way into the symfony codebase since february 2007, so I don't know if it's a good way to fix it and since I'm using symfony as an SVN external I'm not satisfied with this.

Is there a proper way to handle this problem or is it a bug?

Thanks a lot, Philipp Rieber