3 require_once('code/wfpl/http.php');
4 require_once('code/wfpl/file.php');
5 require_once('code/ie_detect.php');
7 # this file is meant to act as a filter for .css files. it removes all lines
8 # containing "remove this line for IE 5.5 and 6"
10 # see also: .htaccess style.css
12 function css_mangler() {
13 $file = $_SERVER['REDIRECT_URL'];
15 $file = substr($file, 1);
17 # links like style_77.css will return style.css
19 # This feature is used as part of a strategy to make sure that the css
20 # file is not cached longer than the html. Also I can shorten loading times
21 # by allowing caching forever.
23 $file = ereg_replace('_[0-9]*[.]css', '.css', $file);
25 if(!file_exists($file)) {
26 header('HTTP/1.0 404 File Not Found');
27 header('Content-Type: text/plain');
28 print("File \"$file\" not found.");
32 header('Content-Type: text/css');
33 http_cache_forever('private'); # serves different content for old IE versions, so no sharing the cache
36 echo(ereg_replace("\n[^\n]*remove this line for IE 5.5 and 6[^\n]*\n", "\n", read_whole_file($file)));