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

mikeytown2 - June 2, 2009 - 06:07

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

AttachmentSize
css_gzip-478506.patch 4.39 KB

#2

mikeytown2 - June 2, 2009 - 06:46
Status:active» needs review

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

#3

mikeytown2 - June 5, 2009 - 22:08
Version:6.x-1.1» 6.x-1.x-dev
AttachmentSize
css_gzip-478506.1.patch 5.07 KB

#4

mikeytown2 - June 9, 2009 - 10:37

New iteration of patch. Should be good to go.

AttachmentSize
css_gzip-478506.2.patch 5.13 KB

#5

mikeytown2 - June 11, 2009 - 08:40
Status:needs review» fixed

committed

#6

System Message - June 25, 2009 - 08:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.