Server error with handcrafted mailto: link

(Michael Brown) #1

The following handcrafted link makes Discourse puke and die with a 500 on posting:

Michael Brown [<>](

(Sam Saffron) #2

Michael Brown <>



(Sam Saffron) #3

We are no longer getting 500s … now adding support for mailto links is in the feature request department :slight_smile: there are plenty of concerns there cause you would only want to allow admins/mods to add these things.

(Sam Saffron) #6

Aha, the error happens later on:

/usr/local/lib/ruby/2.0.0/uri/mailto.rb:150:in `initialize'
/usr/local/lib/ruby/2.0.0/uri/common.rb:214:in `new'
/usr/local/lib/ruby/2.0.0/uri/common.rb:214:in `parse'
/usr/local/lib/ruby/2.0.0/uri/common.rb:747:in `parse'
/usr/local/lib/ruby/2.0.0/uri/common.rb:996:in `URI'
/var/www/discourse/lib/pretty_text.rb:263:in `block in make_all_links_absolute'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/nokogiri- `block in each'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/nokogiri- `upto'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/nokogiri- `each'
/var/www/discourse/lib/pretty_text.rb:260:in `make_all_links_absolute'
/var/www/discourse/lib/pretty_text.rb:278:in `format_for_email'
/var/www/discourse/app/helpers/user_notifications_helper.rb:71:in `cooked_post_for_email'
unrecognised opaque part for mailtoURL:

Looks fairly straight forward to fix

(Sam Saffron) #7

Should be fixed by:

(Sam Saffron) #8