mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Safely skip secure_media steps when it's not enabled (#11110)
* FIX: Safely skip secure_media steps when it's not enabled * DEV: Secure media tests should enable secure media
This commit is contained in:
committed by
GitHub
parent
d2116f0029
commit
b70b3e867c
@@ -278,7 +278,7 @@ module Email
|
||||
def to_html
|
||||
# needs to be before class + id strip because we need to style redacted
|
||||
# media and also not double-redact already redacted from lower levels
|
||||
replace_secure_media_urls
|
||||
replace_secure_media_urls if SiteSetting.secure_media?
|
||||
strip_classes_and_ids
|
||||
replace_relative_urls
|
||||
|
||||
|
||||
@@ -432,7 +432,7 @@ module PrettyText
|
||||
|
||||
# images by themselves or inside a onebox
|
||||
doc.css('img[src]').each do |img|
|
||||
url = if img.parent.classes.include?("aspect-image")
|
||||
url = if img.parent.classes.include?("aspect-image") && img.attributes["srcset"].present?
|
||||
|
||||
# we are using the first image from the srcset here so we get the
|
||||
# optimized image instead of the original, because an optimized
|
||||
|
||||
Reference in New Issue
Block a user