We're updating the issue view to help you get more done. 

Date search regex matches s, not whitespace

Description

What's wrong
The regex on line 27 of app/models/search.rb is:

1 /^([<>]*)\s*([\d -]+)\s*(year|week|month|day|hour)s?(\s*ago)?s*$/

So instead of matching any amount of whitespace at the end, it instead matches any amount of the letter s.

What it should be

1 /^([<>]*)\s*([\d -]+)\s*(year|week|month|day|hour)s?(\s*ago)?\s*$/

To test:

On the work search page, make sure entering "2 days ago" and "2 days ago " in the Date field gets the same results, and that "2 days agos" does not get the same results.

Note:
Credit Russell Flaum

Environment

None

Status

Assignee

Unassigned

Reporter

Sarken

Roadmap

Search
Works

Priority

Medium

Affects versions

0.9.198

Fix versions

Components

BackEnd

Difficulty

Medium

Required Access Level

None

Milestone

Internal 0.9