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

Roundcube 1.2.5 - Comment notations within style tag issues #5747

Closed
stefanogironella opened this issue May 2, 2017 · 7 comments
Closed

Comments

@stefanogironella
Copy link

Hi, I've noticed a strange behaviour after upgrading from RC 1.2.3 to 1.2.5.
HTML e-mails seems to be a little broken when dealing with "comment notations" in style tag.
Removing comments from the style tag, obviously, fix the issue.

This is how a test massage looks in RC 1.2.3:
preview_1 2 3

And this is how same message looks in RC 1.2.5 and 1.2.4 too (note the missing formatting, colors, ...):
preview_1 2 5

To reproduce this, I've used same configuration on both testing environments.

Attached below, the e-mail template used in this example.

email-template.html.zip

Anyone else is facing the same issue or have an idea on how to fix this?

Thanks

@thomascube
Copy link
Member

Seems like the recently added strip_tags removes the entire style tag content... not quite what was intended.

@stefanogironella
Copy link
Author

Do you refer to ./roundcubemail-1.2.5/program/lib/Roundcube/rcube_utils.php (line 505)?

$out = strip_tags($out);

Doing a quick test, commenting this line out, seems to fix my issue but I'm not aware of related drawbacks (if any).

@alecpl
Copy link
Member

alecpl commented May 3, 2017

This was added to fix a security issue, so we can't just remove the command. We'd rather strip comments the way we do it in https://github.com/roundcube/roundcubemail/blob/master/program/lib/Roundcube/rcube_washtml.php#L635.

@alecpl alecpl added this to the 1.3.0 milestone May 3, 2017
@alecpl
Copy link
Member

alecpl commented May 5, 2017

Actually we have to strip only the comment marks not the content inside. While this is an old technique to put comments inside the <style> tag it's not needed at least since 10 years. Anyway, we could remove those markers if found on the content start and end.

alecpl added a commit that referenced this issue May 5, 2017
alecpl added a commit that referenced this issue May 5, 2017
alecpl added a commit that referenced this issue May 5, 2017
@alecpl alecpl closed this as completed May 5, 2017
@stefanogironella
Copy link
Author

Ok, fixed while reading messages but issue still remains when trying to reply a message containing comments within style tag.
Any help?

@alecpl
Copy link
Member

alecpl commented May 5, 2017

Did it work before 1.2.5?

@stefanogironella
Copy link
Author

I really don't know... but i think it should.

note: I've opened a new issue for that, do I have to close it?

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

3 participants