Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate extensions in assets htaccess #658

Open
2 tasks done
PortableSteve opened this issue Nov 12, 2024 · 1 comment
Open
2 tasks done

Duplicate extensions in assets htaccess #658

PortableSteve opened this issue Nov 12, 2024 · 1 comment

Comments

@PortableSteve
Copy link

Module version(s) affected

2.3.0

Description

File extensions are duplicated in the RewriteCond directive in public/assets/.htaccess if there are multiple config files that add the same extension to the allowed_extensions list - whether the config files are in the app directory or a third-party package, of a combination of both.

How to reproduce

See repo: https://github.com/PortableSteve/ss-assets-test

Possible Solution

Update \SilverStripe\Assets\File::getAllowedExtensions() to include a check for the extension before adding it to the $allowedExtensions array:

if (!in_array($key, $allowedExtensions)) {
    $allowedExtensions[] = $key;
}

Additional Context

No response

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)
@GuySartorelli
Copy link
Member

The solution you describe sounds sensible. Would you like to raise a PR to implement that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants