Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent content quotation in html_* classes #3782

Closed
rcubetrac opened this issue May 21, 2012 · 4 comments
Closed

Inconsistent content quotation in html_* classes #3782

rcubetrac opened this issue May 21, 2012 · 4 comments

Comments

@rcubetrac
Copy link

Reported by @alecpl on 21 May 2012 08:42 UTC as Trac ticket #1488485

  1. I see, while html_textarea and html_select use content quotation, html_table doesn't. For consistency we could add TD content quotation too.
  2. html::quote() doesn't allow "double quotation". While this can be useful for folders list selector (indentated with  ) this is problematic when we want "double quoting". I found that "double quoted" content fixes TinyMCE related issue #1488483. This one can be worked around because we have
if (!empty($value) && !preg_match('/mce_editor/', $this->attrib[html_textarea::show() but all of this doesn't look consistent.
[[BR]('class']))

in)]
The proposal is to quote content by default and add a special (bool) attribute 'is_escaped' which will disable quoting. This way we can remove preg_replace call from html::quote().

Keywords: template html quoting
Migrated-From: http://trac.roundcube.net/ticket/1488485

@rcubetrac
Copy link
Author

Comment by @thomascube on 21 May 2012 12:28 UTC

Replying to alec:

  1. I see, while html_textarea and html_select use content quotation, html_table doesn't. For consistency we could add TD content quotation too.

While table cells can most likely contain HTML content, textareas and select menus don't. That's why there's a difference.

  1. html::quote() doesn't allow "double quotation". While this can be useful for folders list selector (indentated with  ) this is problematic when we want "double quoting".

I don't really see a situation where double quotation is desired.

The proposal is to quote content by default and add a special (bool) attribute 'is_escaped' which will disable quoting. This way we can remove preg_replace call from html::quote().

That would mean we have to add 'is_escaped' to almost every call of a container tag. Veto!

@rcubetrac
Copy link
Author

Comment by @alecpl on 21 May 2012 13:19 UTC

Ok. I still think that the check for 'mce_editor' in class attribute doesn't look right where it is. We should replace it with 'is_escaped' attribute.[also still think that "double quotation" prevention looks redundant. If we know what we put to the class, that it is already quoted, we should just tell the class to not quote again. One simple check would be much faster than html::quote() call. Of course, only html_select and html_textarea are involved.
[[BR]([BR]]
[[BR]]
I)][[BR]]
BTW, it looks like we need "double quotation" for TinyMCE textareas.

@rcubetrac
Copy link
Author

Comment by @alecpl on 22 May 2012 09:08 UTC

Done in 0a1dd5b.

@rcubetrac
Copy link
Author

Status changed by @alecpl on 22 May 2012 09:08 UTC

new => closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant