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

Add configuration option to allow more file types in the _media directory #39

Closed
caendesilva opened this issue Jun 12, 2022 · 1 comment · Fixed by #105
Closed

Add configuration option to allow more file types in the _media directory #39

caendesilva opened this issue Jun 12, 2022 · 1 comment · Fixed by #105
Assignees

Comments

@caendesilva
Copy link
Member

caendesilva commented Jun 12, 2022

As Hyde strives to be safe by default, currently the glob pattern for _media file transfers is set to "safe" files. However, it would be nice to have the config option to expand on this.

@caendesilva caendesilva transferred this issue from hydephp/framework Jun 15, 2022
@caendesilva caendesilva self-assigned this Jun 24, 2022
@caendesilva
Copy link
Member Author

Implemented. You can now specify comma separated values in the config.

Here are the defaults:

config('hyde.media_extensions', 'png,svg,jpg,jpeg,gif,ico,css,js'))

Here is how the glob pattern is now loaded in the CollectionService for reference:

return glob(Hyde::path('_media/*.{'.str_replace(' ', '',
    config('hyde.media_extensions', 'png,svg,jpg,jpeg,gif,ico,css,js')).'}'), GLOB_BRACE
);

caendesilva added a commit that referenced this issue Jun 25, 2022
## v0.43.0-beta - 2022-06-25 - File-based Collections

### Added
- Added configuration option `hyde.media_extensions` to allow you to specify additional comma separated media file types. #39
- Adds a safer config option `hyde.output_directory` for customizing the output directory
- Adds a file-based way to create and interact with collections, https://hydephp.com/docs/master/collections

### Removed
- Removed the `--pretty` build command option which was deprecated in v0.25.x
- Removed deprecated internal AssetManager trait which was replaced with the Asset facade

### Fixed
- HydeRC: Fixes a bug in the auxiliary exception handler leading to unintentional recursion causing out of memory errors in both the browser and the PHP server.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant