This project is closed and read-only.
Actions
Backport #6853
closedRegular Expression Bug
Backport #6853:
Regular Expression Bug
Status:
Closed
Assignee:
Description
I'm getting a seg fault with the following code:
resources :products, :only => %w(show) do
collection do
get ':user_platform/:app_guid(/:template)', :action => 'index', :as => '',
:defaults => { :template => 'appwall' },
:constraints => { :user_platform => /[a-z][a-z0-9-\s]+/i, :app_guid => /[0-9a-z-.]+/i }
end
end
The culprit is the line with :constraints, specifically the trailing '-' in user_platform.
I tested the expression on Rubular and it's not a problem. Older versions of ruby will return a warning but won't crash. Removing the '-' fixes the problem.
Files
Actions