Gzip outside of root directory?
morningtime - June 1, 2009 - 10:12
| Project: | CSS Gzip |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
When I enable the Gzip functions, I get error messages that the gss.gz file is outside the open base dir. I located the problem at line 61 and 62 of css_gzip.module. The $css_file is something like '/css/827498247923.css.gz'. However, that is outside the server root! I could fix the problem by adding $_SERVER['DOCUMENT_ROOT'] and $path in front of $css_file, like so:
if (!file_exists($_SERVER['DOCUMENT_ROOT'] . $path . $css_file .'.gz')) {
file_save_data(gzencode(file_get_contents(file_directory_path() . $css_file), 9), $_SERVER['DOCUMENT_ROOT'] . $path . $css_file .'.gz', FILE_EXISTS_REPLACE);
}What could be the real problem? Why does it want to store gzipped css files outside the root dir? The funny thing is, it does actually work with the errors.

#1
While we are here, I might as well clean this module up. Here's the proposed changes along with the fix.
#2
reminder to self to change readme.txt; remove safari code.
#3
#4
New iteration of patch. Should be good to go.
#5
committed
#6
Automatically closed -- issue fixed for 2 weeks with no activity.