mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-07 17:36:22 +08:00
Sometimes, HTML entities can be escaped twice, typically when getting sanitized data from our `Onebox::OpenGraph` class then providing that value to a template. We’re using the Mustache gem to process the Onebox templates, and it will automatically escape HTML entities. This is usually not a problem, but it is for things like ampersands. For example, if the value we provide to the template is `&`, then Mustache will convert it to `&`. This patch fixes that behavior by decoding the result of the sanitization we apply in `Onebox::OpenGraph`. That way, templates will get `&` instead of `&`, thus there won’t be any double escaping. |
||
|---|---|---|
| .. | ||
| engine | ||
| mixins | ||
| templates | ||
| domain_checker.rb | ||
| engine.rb | ||
| file_type_finder.rb | ||
| helpers.rb | ||
| json_ld.rb | ||
| layout.rb | ||
| layout_support.rb | ||
| matcher.rb | ||
| movie.rb | ||
| normalizer.rb | ||
| oembed.rb | ||
| open_graph.rb | ||
| preview.rb | ||
| sanitize_config.rb | ||
| status_check.rb | ||
| template_support.rb | ||
| view.rb | ||