Problem/Motivation
The update_manager_file_get()
function checks the argument url against a small hard-coded list of remote file schemes, and assumes that all other URIs may be resolved to paths on the local filesystem. This assumption is wrong and unnecessary. The code may be made simpler and more robust by simply passing the URI to \Drupal::service('file_system')->realpath()
A return value of FALSE
indicates that the scheme does not support translation to a local filesystem path.
Proposed resolution
The code should be modified as described above.
Remaining tasks
Review patch
Commit
User interface changes
None.
API changes
None.
Comment | File | Size | Author |
---|---|---|---|
#20 | 1283536-20.patch | 1.65 KB | smustgrave |
| |||
#20 | interdiff-18-20.txt | 632 bytes | smustgrave |
Comments
Comment #1
pillarsdotnet CreditAttribution: pillarsdotnet commentedPatch.
Comment #2
Leeteq CreditAttribution: Leeteq commentedThis one needs to be tagged as "backport to D7", I guess.
Comment #3
pillarsdotnet CreditAttribution: pillarsdotnet commentedSure; why not?
Comment #4
kscheirer#1: update_manager_file_get-fix-drupal_realpath-usage-1283536-1.patch queued for re-testing.
Comment #5.0
(not verified) CreditAttribution: commentedUpdated status.
Comment #17
quietone CreditAttribution: quietone at PreviousNext commentedDiscuss at Bug smash group triage meeting. This code is still in drupal 9.5.x, so tagging for a reroll.
Comment #18
smustgrave CreditAttribution: smustgrave at Mobomo commentedComment #19
Amber Himes MatzThis needs an issue summary update a new proposed resolution because the use of drupal_realpath() was originally written to ease porting of 6.x code to use 7.x stream wrappers. (See #1201024: drupal_realpath() should describe when it should be used and #1083982: Fix support for remote streamwrappers.)
Comment #20
smustgrave CreditAttribution: smustgrave at Mobomo commentedUpdated IS hopefully makes sense.
Comment #22
smustgrave CreditAttribution: smustgrave at Mobomo commentedSelf review.
This will need a test case.