Only yield valid references in ReferenceFilter.references_in
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/27648 as seen below:
Inside IssueReferenceFilter
, project_from_ref_cached(perfectly_valid_project_path)
resulted in project_refs_cache[perfectly_valid_project_path]
being set to nil
if an invalid (IID < 0 || IID > MAX_INT
) reference was included, which would affect subsequent filters too, sine they use the same project_refs_cache
.
This fixes the issue where AbstractReferenceFilter#references_per_project
checks object_class.reference_valid?(symbol)
, but AbstractReferenceFilter.references_in
didn't, which resulted in the incorrect cache set.