Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up to #1956698: Prevent access to YAML files using .htaccess and web.config
Problem/Motivation
file_htaccess_lines()
is a fairly useless one-line procedural wrapper for a primarily internal function.
Proposed resolution
Deprecate the wrapper and move all relevant information and usages to the wrapped method.
Beta phase evaluation
Issue category | Task; there is no functional bug. |
---|---|
Prioritized changes | This is a normal followup from a critical issue, #1956698: Prevent access to YAML files using .htaccess and web.config, but otherwise not a prioritized change. There is an extremely minor impact on developer experience through reducing the public API, but not enough to merit the equally minor BC break during the beta. |
Disruption | Marking the function as deprecated will cause no disruption for core, contrib, or custom modules, and there is only one usage in core to convert (plus a test). |
Remaining tasks
Patch needs review.
User interface changes
N/A
API changes
file_access_lines()
removed.
Comment | File | Size | Author |
---|---|---|---|
#12 | interdiff-deprecate-12.txt | 1.06 KB | xjm |
#12 | file-2332047-12.patch | 3.06 KB | xjm |
#2 | remove-file-htaccess-lines.patch | 3.42 KB | xjm |
Comments
Comment #1
xjmChange record draft: https://www.drupal.org/node/2332051
Comment #2
xjmComment #3
xjmComment #4
xjmComment #6
marvil07 CreditAttribution: marvil07 commentedLess globals FTW, specially if they are used once, just re-tested.
Comment #7
alexpottThis issue is a normal task so we need to outline how it fits within the allowable Drupal 8 beta criteria. Can someone add Drupal 8 beta phase evaluation template to the issue summary.
I think it is fine to replace the usages and deprecate the procedural function for 9.x since the static method on the class already exists.
Comment #8
xjmComment #9
xjmComment #10
xjmComment #12
xjmRerolled to deprecate the function instead (the original patch was posted before the beta). Also added the beta evaluation. The DX impact of having one fewer global doesn't justify a BC break during the beta (no matter how small), but we can deprecate it to the same end, and it was a followup from a critical originally, which is a category of issue allowed during the beta.
Comment #13
marvil07 CreditAttribution: marvil07 commentedWell, at least deprecating is a good step forward now.
Thanks for the new patch!
Comment #14
catchCommitted/pushed to 8.0.x, thanks!
Comment #17
quietone CreditAttribution: quietone at PreviousNext commentedpublish change record