lib/onebox/engine/wechat_mp_onebox.rb in onebox-1.9.23 vs lib/onebox/engine/wechat_mp_onebox.rb in onebox-1.9.24
- old
+ new
@@ -24,10 +24,10 @@
private
def extract_script_value(var_name)
if (script_elem = raw.css("script").select { |script| script.inner_text.include? "var #{var_name} = " }) && script_elem.any?
e = Nokogiri::HTML(script_elem[0].inner_text.match(/var\s+#{Regexp.quote(var_name)}\s+=\s+"(.*?)";/)[1])
- return CGI::unescapeHTML(e.text.scan(/(?:\\x([a-f0-9]{2}))|(.)/i).map { |x| x[0] ? [x[0].to_i(16)].pack('U') : x[1] }.join)
+ CGI::unescapeHTML(e.text.scan(/(?:\\x([a-f0-9]{2}))|(.)/i).map { |x| x[0] ? [x[0].to_i(16)].pack('U') : x[1] }.join)
end
end
# TODO need to handle hotlink protection from wechat
def image