$options['nomask'] regex from file_scan_ignore_directories is incorrect

Created on 7 August 2021, almost 4 years ago
Updated 17 June 2025, 7 days ago

Problem/Motivation

Files that should not be excluded may be excluded. In the example below, the file called distort.png is excluded but it should not be.

Steps to reproduce

  1. Set file_scan_ignore_directories to ['dist', 'vendor']
  2. Create a directory that contains a file called distort.png
  3. Run scanDirectory against it

Proposed resolution

The generated regex for nomask should contain parentheses.

Wrong: ^dist|vendor$
Correct: ^(dist|vendor)$

Remaining tasks

This same issues exists with the earlier versions, I'm not sure what to do about that, but it needs to be back-ported. I actually found this in version 8.

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

file system

Created by

πŸ‡ΊπŸ‡ΈUnited States aklump

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024