Update directory object filter to always force strict matches and only continue allowing wildcard matches if an asterisk (*) is the last character. Before this change, wildcard matches were allowed by default with no delimiter, potentially allowing a false match to occur.
For example, previously if the nested directory object being checked was /path/to/object-1/ and the filter given was /path/to/object then /path/to/object-1/ would be included. This was not intended, which is why the trailing slash was originally appended to create the $nested_dir_object variable. This prevented false matches in the future inclusion check, but not the past inclusion check. By also appending the trailing slash to the filter object, which would be /path/to/object/ in this example, this will not occur.
A wildcard match is still however needed in some cases, like a change to the system cache clearing that I will be introducing after this. Providing a trailing asterisk will allow that wildcard matching behavior to continue, where if /path/to/object-* was the filter it would match /path/to/object-1, /path/to/object-2, etc. This same behavior has been extended for exclusions as well now (e.g. if /path/to/object-* was the excluded filter it would match everything but /path/to/object-1, /path/to/object-2, etc.).
Update directory object filter to always force strict matches and only continue allowing wildcard matches if an asterisk (
*
) is the last character. Before this change, wildcard matches were allowed by default with no delimiter, potentially allowing a false match to occur.For example, previously if the nested directory object being checked was
/path/to/object-1/
and the filter given was/path/to/object
then/path/to/object-1/
would be included. This was not intended, which is why the trailing slash was originally appended to create the$nested_dir_object
variable. This prevented false matches in the future inclusion check, but not the past inclusion check. By also appending the trailing slash to the filter object, which would be/path/to/object/
in this example, this will not occur.A wildcard match is still however needed in some cases, like a change to the system cache clearing that I will be introducing after this. Providing a trailing asterisk will allow that wildcard matching behavior to continue, where if
/path/to/object-*
was the filter it would match/path/to/object-1
,/path/to/object-2
, etc. This same behavior has been extended for exclusions as well now (e.g. if/path/to/object-*
was the excluded filter it would match everything but/path/to/object-1
,/path/to/object-2
, etc.).This updates what was originally added in #237.