Issue Details (XML | Word | Printable)

Key: MDL-12275
Type: Bug Bug
Status: Resolved Resolved
Resolution: Cannot Reproduce
Priority: Critical Critical
Assignee: Petr Škoda (skodak)
Reporter: Rob Faulkner
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Broken images and HTML returned through file.php

Created: 20/Nov/07 10:15 PM   Updated: 20/Nov/07 11:53 PM
Component/s: Course
Affects Version/s: 1.8.3
Fix Version/s: None

File Attachments: None
Image Attachments:

1. filephpproblems.gif
(17 kB)
Environment:
Windows Server 2003 R2, IIS 6, PHP 5, MySQL 5

XP Clients, IE6/7, FF1.5+, perhaps others

Participants: Petr Škoda (skodak) and Rob Faulkner
Security Level: None
Resolved date: 20/Nov/07
Affected Branches: MOODLE_18_STABLE


 Description  « Hide
Since moving to 1.8.3 images and HTML are returned broken through file.php. I can very occasionally get an unbroken through, but this is highly unpredictable. HTML pages stored within MOODLEDATA also are missing the last few characters (ending '</html ' for example) and on firefox HTML pages have two garbage characters at the start of the page. All files are fine when viewed directly from MOODLEDATA and by moving them into the wwwroot and serving through the webserver without file.php

Move to 1.8.3 was a new installation, on the same server, rather than a 1.8.2 upgrade.

In IE if I view the image directly in the browser with file.php, rather than embedded in a page, it is broken but if I refresh a few times I get the file content. See attached.

Have tried changing the character encoding of the HTML files to no effect.

Have checked config.php, file.php, filelib.php and libcurlemu for trailing whitespace.

Please help! I ignored this problem during testing of the new installation due to MDL-10882, but still had this problem switching over.



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Škoda (skodak) added a comment - 20/Nov/07 10:51 PM
This is definitely a problem with trailing whitespace either in config.php or some other library file. Please fix your config.php or upload fresh php files if it does not help. thanks

Rob Faulkner added a comment - 20/Nov/07 10:56 PM - edited
I suspected as much initally, many php files from the moodle distro have trailing blank lines when unzipped on this installation. But also on my installation that does work!

Is there any guidance to avoiding this on win32, possibly a specific unzipping routine (my suspicion being something like use winrar rather than the inbuilt windows unzip)

I came across a sed script for removing blank lines somewhere too, does a similar thing exist for win32?

Many thnaks,

Rob.