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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

FileSize
4.39 KB

While we are here, I might as well clean this module up. Here's the proposed changes along with the fix.

mikeytown2’s picture

Status: Active » Needs review

reminder to self to change readme.txt; remove safari code.

mikeytown2’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
FileSize
5.07 KB
mikeytown2’s picture

FileSize
5.13 KB

New iteration of patch. Should be good to go.

mikeytown2’s picture

Status: Needs review » Fixed

committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.