discourse/lib/onebox/engine/five_hundred_px_onebox.rb
Blake Erickson 17116c440b
SECURITY: Restrict allowed URL patterns
Restrict allowed URL patterns for oneboxes.
2025-02-04 13:32:34 -03:00

23 lines
471 B
Ruby

# frozen_string_literal: true
module Onebox
module Engine
class FiveHundredPxOnebox
include Engine
include StandardEmbed
matches_domain("500px.com")
always_https
def self.matches_path(path)
path.match?(%r{^/photo/\d+/})
end
def to_html
og = get_opengraph
"<img src='#{og.image}' width='#{og.image_width}' height='#{og.image_height}' class='onebox' #{og.title_attr}>"
end
end
end
end