logo       

[bug] file uploads require PHP 4.3: msg#00995

php.drupal.devel

Subject: [bug] file uploads require PHP 4.3

Project: Drupal
Version: cvs
Component: base system
Category: bug reports
Priority: normal
Assigned to: Anonymous
Reported by: Bart Jansens
Updated by: Anonymous
Status: active

Nope. Since we define the constants, they only need to be defined, if
they are not defined yet. You do the same with functions...

[?php
if (!function_exists('file_get_contents')) {
function file_get_contents(...) {
...
}
}
?]

Checking for PHP version is odd... Only the constants are the problem
as the reported indicated. Please apply Bart's patch.

Anonymous



Previous comments:
------------------------------------------------------------------------

February 15, 2004 - 12:55 : Bart Jansens

Attachment: http://drupal.org/files/issues/20040215.file-constants.patch (629
bytes)

file.inc uses constants that only exist in PHP 4.3 or higher
(http://nl.php.net/manual/en/features.file-upload.errors.php) causing
file uploads to fail in PHP 4.2.

------------------------------------------------------------------------

February 15, 2004 - 15:40 : Dries

Committed to HEAD. Thanks.

------------------------------------------------------------------------

February 15, 2004 - 15:46 : Goba

This should be wrapped in an if (defined('UPLOAD_ERR_OK')) IMHO, since
after this patch, the code will not work with PHP 4.3+ :)

------------------------------------------------------------------------

February 23, 2004 - 21:31 : Bart Jansens

Attachment: http://drupal.org/files/issues/file-constants2.patch (853 bytes)

Unfortunatly i'm not seeing the notices but the attached patch should
fix this :)

------------------------------------------------------------------------

February 25, 2004 - 22:43 : ax

tested and working (no more notices). please apply.

------------------------------------------------------------------------

February 26, 2004 - 11:50 : magico

I think that is better to check for PHP version instead of checking for
one constant definition.

// Required for file uploads to work with PHP 4.2
if (version_compare(phpversion(), '4.2.0', '

--
View: http://drupal.org/node/view/5874
Edit: http://drupal.org/project/comments/add/5874





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise