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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | css_gzip-478506.2.patch | 5.13 KB | mikeytown2 |
| #3 | css_gzip-478506.1.patch | 5.07 KB | mikeytown2 |
| #1 | css_gzip-478506.patch | 4.39 KB | mikeytown2 |
Comments
Comment #1
mikeytown2 commentedWhile we are here, I might as well clean this module up. Here's the proposed changes along with the fix.
Comment #2
mikeytown2 commentedreminder to self to change readme.txt; remove safari code.
Comment #3
mikeytown2 commentedComment #4
mikeytown2 commentedNew iteration of patch. Should be good to go.
Comment #5
mikeytown2 commentedcommitted