Closed (outdated)
Project:
Drupal core
Version:
6.x-dev
Component:
file system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Dec 2007 at 14:40 UTC
Updated:
2 Mar 2016 at 22:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
artifice commentedRelates to: #261392: file_check_location() fails when file does not exist and #184992: file_check_location() doesn't actually do what is described and #48350: upload module puts tmp file but won't move file to final directory location
Comment #2
drewish commentedwe ran into this trying to write unit tests for the hook_file patch (#142995: Add hook_file and make files into a 1st class Drupal object).
marked #261392: file_check_location() fails when file does not exist as a duplicate
Comment #3
drewish commentedHere's the test we built for this bug:
I'm forking it from #308434: Clean up file.inc ahead of hook_file and add unit tests. so that all the tests committed will pass.
Comment #4
p.brouwers commentedMade a patch for it.
See http://drupal.org/node/339863 also for D5 patch
Comment #5
dries commenteddrewish's test is not included in the patch?
Comment #6
p.brouwers commentedI don't get it. Should it?
Seems to me that Drewish's patch is already commit, and this patch can still be applied to it.
Comment #7
drewish commentedp.brouwers no you need to incorporate the test that i'd posted in #3
Comment #8
p.brouwers commentedah ok, will incorporate your test and submit a new patch
Comment #9
p.brouwers commentedok, added your test drewish and corrected the other tests to reflect the change to file_check_location()
Comment #10
lacasuela commentedwhich file we must patch in drupal 6.8 and how?
Comment #11
sinasquax commentedI'm ok with the patch #9, webform module use file_check_location with /webform/ path in his file_download hook but it doesn't create the webform folder in sites/default/files.
So i get many "realpath() open_basedir restriction in effect" warnings.
Comment #12
p.brouwers commentedWhat's the current status on this subject?
Comment #13
praestigiare commentedI am not sure if this is the correct place to put this, so forgive me if I am making a mistake. I made a patch for Drupal 6, with a slight modification: On windows systems, running realpath() on non-existent directories can be very slow in some cases. To avoid this, I moved the is_dir() check to before the realpath() call.
Comment #14
praestigiare commentedSorry - left out the directory info in the patch header.
Comment #15
Désiré commentedSince the file_check_location function is removed from Drupal 7 this bug was not fixed, but it still effects Drupal 6 sites.
Comment #16
tamas.varga commentedHere is a current patch for 6.x drupal core