mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 17:40:43 +08:00
DEV: Prefer \A and \z over ^ and $ in regexes (#19936)
This commit is contained in:

committed by
GitHub

parent
f7907a3645
commit
666536cbd1
@ -32,8 +32,8 @@ module Onebox
|
||||
doc
|
||||
.css("meta")
|
||||
.each do |m|
|
||||
if (m["property"] && m["property"][/^(?:og|article|product):(.+)$/i]) ||
|
||||
(m["name"] && m["name"][/^(?:og|article|product):(.+)$/i])
|
||||
if (m["property"] && m["property"][/\A(?:og|article|product):(.+)\z/i]) ||
|
||||
(m["name"] && m["name"][/\A(?:og|article|product):(.+)\z/i])
|
||||
value = (m["content"] || m["value"]).to_s
|
||||
next if Onebox::Helpers.blank?(value)
|
||||
key = $1.tr("-:", "_").to_sym
|
||||
|
Reference in New Issue
Block a user