mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
DEV: Replace custom Onebox symbolize_keys implementation with ActiveSupport (#23828)
We have a custom implementation of #symbolize_keys in our Onebox helpers. This is likely a legacy from when Onebox was a standalone gem. This change replaces all usages with either #deep_symbolize_keys from ActiveSupport, or appropriate option to the JSON parser gem used.
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
module Onebox
|
||||
class Oembed < OpenGraph
|
||||
def initialize(response)
|
||||
@data = Onebox::Helpers.symbolize_keys(::MultiJson.load(response))
|
||||
@data = ::MultiJson.load(response, symbolize_keys: true)
|
||||
|
||||
# never use oembed from WordPress 4.4 (it's broken)
|
||||
@data.delete(:html) if @data[:html] && @data[:html]["wp-embedded-content"]
|
||||
|
Reference in New Issue
Block a user