mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
DEV: correct a few Ruby 2.7 deprecations
Note: ``` def foo(bar: 1) end foo({bar: 2}) # raises a deprecation, instead use: foo(**{bar: 2}) ``` Additionally when matching regexes always use strings. It does not make sense to match a non string to a regex.
This commit is contained in:
@ -25,7 +25,13 @@ class MetadataController < ApplicationController
|
||||
private
|
||||
|
||||
def default_manifest
|
||||
display = Regexp.new(SiteSetting.pwa_display_browser_regex).match(request.user_agent) ? 'browser' : 'standalone'
|
||||
display = "standalone"
|
||||
if request.user_agent
|
||||
regex = Regexp.new(SiteSetting.pwa_display_browser_regex)
|
||||
if regex.match(request.user_agent)
|
||||
display = "browser"
|
||||
end
|
||||
end
|
||||
|
||||
manifest = {
|
||||
name: SiteSetting.title,
|
||||
|
Reference in New Issue
Block a user