Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix overlapping character ranges in regex

Christophe Bliard20370871cdee
diff --git a/config/routes.rb b/config/routes.rb
index 3112563eb96..89c4963a26d 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -317,29 +317,29 @@ Rails.application.routes.draw do
get "(/revisions/:rev)/diff(/*repo_path)",
action: :diff,
format: "html",
- constraints: { rev: /[\w0-9.\-_]+/, repo_path: /.*/ }
+ constraints: { rev: /[\w.\-]+/, repo_path: /.*/ }
get "(/revisions/:rev)/:format/*repo_path",
action: :entry,
format: /raw/,
- rev: /[\w0-9.\-_]+/
+ rev: /[\w.\-]+/
%w{diff annotate changes entry browse}.each do |action|
get "(/revisions/:rev)/#{action}(/*repo_path)",
format: "html",
action:,
- constraints: { rev: /[\w0-9.\-_]+/, repo_path: /.*/ },
+ constraints: { rev: /[\w.\-]+/, repo_path: /.*/ },
as: "#{action}_revision"
end
- get "/revision(/:rev)", rev: /[\w0-9.\-_]+/,
+ get "/revision(/:rev)", rev: /[\w.\-]+/,
action: :revision,
as: "show_revision"
get "(/revisions/:rev)(/*repo_path)",
action: :show,
format: "html",
- constraints: { rev: /[\w0-9.\-_]+/, repo_path: /.*/ },
+ constraints: { rev: /[\w.\-]+/, repo_path: /.*/ },
as: "show_revisions_path"
end
end