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.
The File API in 4.4.0 won't work with PHP < 4.3.3. See the PHP manual: the fgets
function used in file_transfer
is not binary safe. This leads to problems with things like Avatars.
See the attached patch for a sure (but slow) fix.
A faster fix needs to be written, or we need to set PHP 4.3.3 or newer as a Drupal requirement.
Comment | File | Size | Author |
---|---|---|---|
#7 | common.inc_0.patch | 743 bytes | drumm |
#3 | common.patch | 547 bytes | killes@www.drop.org |
#1 | drupal_18 | 505 bytes | killes@www.drop.org |
file.patch | 246 bytes | Frodo Looijaard | |
Comments
Comment #1
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedAfter some discussion with Kjartan on #drupal I tested the proposed solution. I found it to be working fine on PHP-4.2.1.
Comment #2
Dries CreditAttribution: Dries commentedWe use
fgets($fd, 1024)
inincludes/common.inc
too.Comment #3
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedhere is the patch for common.inc
Comment #4
Dries CreditAttribution: Dries commentedCommitted to both HEAD and DRUPAL-4-4. Thanks.
Comment #5
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedPlease revert that second patch. According to drumm it causes drupal_http_header to break and treat everything as header.
Comment #6
drummThe patch to common.inc breaks the processing which happens later in the drupal_http_request function. That processing depends on the $response array to be broken by newlines. Switching functions removed that property of the array. This causes everyhting to be dumpted into the header array because it never encounters a blank array element representing a blank line. This makes me question what might happen with an unpatched common.inc getting a file with http headers longer than 1024 characters.
Comment #7
drummHere is a patch to fix it while using the new function. Its better than the old behavior because it handles header lines longer than 1024 characters.
Its equally bad as the old (prepatch) behavior if we look at RFC 822, section 3.1.1 (referenced by RFC 2616 (http 1.1), section 4.2). To sum up that section, http headers can be multiple lines and we don't handle that case now.
Comment #8
Dries CreditAttribution: Dries commentedCommitted to HEAD and DRUPAL-4-4. Thanks drumm.
Comment #9
(not verified) CreditAttribution: commented