mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Prefer \A and \z over ^ and $ in regexes (#19936)
This commit is contained in:
committed by
GitHub
parent
f7907a3645
commit
666536cbd1
@@ -15,8 +15,8 @@ class RemoteTheme < ActiveRecord::Base
|
||||
|
||||
ALLOWED_FIELDS = %w[scss embedded_scss head_tag header after_header body_tag footer]
|
||||
|
||||
GITHUB_REGEXP = %r{^https?://github\.com/}
|
||||
GITHUB_SSH_REGEXP = %r{^ssh://git@github\.com:}
|
||||
GITHUB_REGEXP = %r{\Ahttps?://github\.com/}
|
||||
GITHUB_SSH_REGEXP = %r{\Assh://git@github\.com:}
|
||||
|
||||
has_one :theme, autosave: false
|
||||
scope :joined_remotes,
|
||||
@@ -329,7 +329,7 @@ class RemoteTheme < ActiveRecord::Base
|
||||
|
||||
def github_diff_link
|
||||
if github_repo_url.present? && local_version != remote_version
|
||||
"#{github_repo_url.gsub(/\.git$/, "")}/compare/#{local_version}...#{remote_version}"
|
||||
"#{github_repo_url.gsub(/\.git\z/, "")}/compare/#{local_version}...#{remote_version}"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user