[drupal-devel] [bug] file_check_location is not working on Windows 2000

dan90 drupal-devel at drupal.org
Wed Feb 23 00:30:44 UTC 2005

 Project:      Drupal
-Version:      cvs
+Version:      4.5.2
 Component:    file system
 Category:     bug reports
 Priority:     critical
 Assigned to:  Anonymous
 Reported by:  ccourtne
 Updated by:   dan90 at drupal.org
 Status:       patch

This also fixed my file upload problems with some nonstandard paths
under Linux/apache, php 4.3.4 drupal 4.5.2. maybe we should remove
mention of windows 2000?

dan90 at drupal.org

Previous comments:

September 16, 2004 - 13:46 : ccourtne

Currently file_check_location is always returning false when passed a
file as the $source path.  If a directory is passed in $soruce
file_check_location works.  I've tracked this down to realpath
returning an empty string when passed a relative path which points to a
file.  This probably goes unnoticed if you are using the file.api's to
construct relative paths to the druapl file directory since
check_location failing just causes the durpal file directory to get
added which is what you wanted in the first place.
Replacing this line
$source = realpath(dirname($source));
with this
$source = realpath(dirname($source));
fixes it on my windows box using PHP 4.3.8.
I don't have things set up to do patches on my windows boxes here at
work yet.  I'll submit a formal patch tonight.


September 16, 2004 - 13:47 : ccourtne

Dag nabit.
$source = realpath($source);
$source = realpath(dirname($source));


September 16, 2004 - 13:56 : Anonymous

Attachment: http://drupal.org/files/issues/file-inc-file_check_location.patch (639 bytes)

The sooner there are patches, the better it is...
I tested this approach on my server and it works.


September 17, 2004 - 01:34 : ccourtne

Attachment: http://drupal.org/files/issues/checklocation.patch (666 bytes)

Here is the patch.

View: http://drupal.org/node/10885
Edit: http://drupal.org/project/comments/add/10885

More information about the drupal-devel mailing list