Allow regex in allowed image styles config

Created on 15 July 2021, over 3 years ago
Updated 8 January 2025, 19 days ago

Problem/Motivation

Currently, the allowed image styles config is an array of strings for the allowed style and params, e.g `image_scale[width]=100`, `image_scale[width]=200`, etc. It would be handy if regex was allowed in the config, e.g. `^image_scale\[width\]=\d00$`.

Proposed resolution

Attached patch allows using regex in the allowed styles config. Exact-match strings are still allowed, for backwards compatibility. Regex matching is used for an entry in the array if the first character of the entry is the regex start delimiter caret '^'.

Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇦Canada bgilhome Victoria

Live updates comments and jobs are added and updated live.
Sign in to follow issues

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