-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Email agent stripping out tags? #1373
Comments
Hi @irfancharania, I can confirm the tables are tripped from the HTML but can not remember a change that could have caused it. Do you know which in revision of Huginn it worked? |
What's the easiest way for me to tell what revision an instance is? |
|
commit efb3bc413613910b69d1381c6f54214ef7168206 |
I did some bisecting and found that 05a4c32 changed the behavior. However the rails CHANGELOGs did not seem to mention anything: rails/rails@v4.2.4...v4.2.5.1 I think we need to figure out how the HTML sanitizer was configured before the rails 4.2.5.1 upgrade and override the defaults in our configuration. |
I'd guess it's due to the restrictive set of allowable tags/attributes (here)[https://github.com/rails/rails-html-sanitizer/blob/master/lib/rails/html/sanitizer.rb#L107-L110]? Would it be possible to define a more permissive global whitelist in Huginn? |
Based on this article, it looks like you could set |
Can you tell me what I'm doing wrong here? sudo -u huginn -H nano sanitizer.rb paste in sudo bundle exec rake production:restart
service nginx restart
sudo bundle exec rake production:check
(in /home/huginn/huginn)
[ OK ] Everything is fine That gives me a 502 error, and 'huginn_error.log' just has connection refused entries |
Actually, try |
That's better! Silly question, but how do I add more tags? |
Without the commas. |
Also, for future, how would I hunt down the source of that 502 error I was getting before? |
I'd expect to see it in the production.log in log/ in the app directory. |
Your solution works! So you think we can add it in the main branch? Here's what I've got: sanitizer.rb ActionView::Base.sanitized_allowed_tags += Set.new(%w(table thead tbody tr th td))
ActionView::Base.sanitized_allowed_attributes += Set.new(%w(border cellspacing cellpadding valign)) |
Seems safe to me. Want to send a PR? |
Sent pull request #1380 |
Merged, thanks for the fix! |
I've updated my huginn instance to the latest version and I'm noticing that the email agent is stripping out a number of tags like table.
Here is a test page: http://rockandsock.neocities.org/index.html
This is a test scenario demonstrating the issue:
The older instance sends emails as expected (with tables)...
Any ideas what the issue could be?
The text was updated successfully, but these errors were encountered: