Add a hook_file_stream_wrapper_uri_normalize_alter() hook

Created on 28 April 2015, over 9 years ago
Updated 30 January 2023, almost 2 years ago

Many contrib modules (and core itself) use file_stream_wrapper_uri_normalize() to ensure that a URI is correct. As is, there is no way for a contrib module adding a stream wrapper to add it's own validation or conditions when normalizing a URL. For example, with the S3 SDK, all URIs must be within a bucket, and a URI like s3://image.jpg is invalid. With this alter hook, a module can alter a URI as needed to meet it's own conditions.

A cleaner option might be to add a normalize method to the stream wrapper interface, and call that directly, but an alter hook seems like the least invasive option while preserving API compatibility.

Feature request
Status

Needs work

Version

10.1

Component
File system 

Last updated about 11 hours ago

Created by

🇨🇦Canada deviantintegral

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.

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Production build 0.71.5 2024