JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
made css_mangler.php handle versioning (strips numerical postfixes) and made contract...
[contractor-progress.git] / css_mangler.php
index 03e55f9..40f0e8e 100644 (file)
@@ -13,7 +13,18 @@ function css_mangler() {
 
        $file = substr($file, 1);
 
+       $file = ereg_replace('_[0-9]*[.]css', '.css', $file);
+
+       $mtime = filemtime($file);
+       if($mtime === false) {
+               header('Content-Type: text/plain');
+               print("cannot stat $file");
+               return;
+       }
+
        header('Content-Type: text/css');
+       header('Last-Modified: '.gmdate('D, d M Y H:i:s', $mtime) . ' GMT');
+       header('Last-Modified: '.gmdate('D, d M Y H:i:s', $mtime) . ' GMT');
 
        if(ie5or6()) {
                echo(ereg_replace("\n[^\n]*remove this line for IE 5.5 and 6[^\n]*\n", "\n", read_whole_file($file)));