JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
added support for ie6
[contractor-progress.git] / css_mangler.php
diff --git a/css_mangler.php b/css_mangler.php
new file mode 100644 (file)
index 0000000..03e55f9
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+
+require_once('code/wfpl/file.php');
+require_once('code/ie_detect.php');
+
+# this file is meant to act as a filter for .css files. it removes all lines
+# containing "remove this line for IE 5.5 and 6"
+
+# see also: .htaccess style.css
+
+function css_mangler() {
+       $file = $_SERVER['REDIRECT_URL'];
+
+       $file = substr($file, 1);
+
+       header('Content-Type: text/css');
+
+       if(ie5or6()) {
+               echo(ereg_replace("\n[^\n]*remove this line for IE 5.5 and 6[^\n]*\n", "\n", read_whole_file($file)));
+       } else {
+               readfile($file);
+       }
+}
+
+css_mangler();
+
+?>