From d8990b87dba2105d4b772a45aaa8a3857dd0e509 Mon Sep 17 00:00:00 2001 From: David Flatz Date: Wed, 10 Dec 2014 16:58:02 +0100 Subject: inject ie polyfils in css when browser is ie 8 or older --- itjs.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'itjs.php') diff --git a/itjs.php b/itjs.php index 6c8113d..83ea79a 100644 --- a/itjs.php +++ b/itjs.php @@ -59,6 +59,12 @@ else if (it::match('\.css', $file)) '([^/])\*(\w)' => '$1$2'), $data ); + if ((($ie = it::match('MSIE (\d+)', $_SERVER['HTTP_USER_AGENT'])) && intval($ie) < 9) || EDC('iecompat')) + $data = it::replace(array( + '([;{]\s*)(background-size:[^;}])' => '\1behavior:url(/itjs/ie-backgroundsize-min.htc);\2', + '([;{]\s*)(border-radius:[^;}]*)' => '\1behavior:url(/itjs/ie-PIE.htc);\2'), + $data + ); } else if (it::match('\.htc$', $file)) { -- cgit v1.2.3