remote ie global, replace with define
This commit is contained in:
parent
d5f1976e62
commit
691003c1ea
1 changed files with 16 additions and 13 deletions
|
@ -3,19 +3,22 @@
|
||||||
/// IE 5 though 8 support IE conditional comments
|
/// IE 5 though 8 support IE conditional comments
|
||||||
/// IE 4 does not (need to fall back to user agent)
|
/// IE 4 does not (need to fall back to user agent)
|
||||||
|
|
||||||
$__ie_ver = FALSE;
|
{
|
||||||
|
if (preg_match('/MSIE\s(?P<v>\d+)/i', @$_SERVER['HTTP_USER_AGENT'], $B)) {
|
||||||
|
define('IE_VERSION', $B['v']);
|
||||||
|
} else {
|
||||||
|
define('IE_VERSION', FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
if (preg_match('/MSIE\s(?P<v>\d+)/i', @$_SERVER['HTTP_USER_AGENT'], $B)) {
|
if (IE_VERSION == FALSE || IE_VERSION > 4) {
|
||||||
$__ie_ver = $B['v'];
|
// ADD COND COMMENTS
|
||||||
}
|
define('IE_START', "<!--[if lt IE 8 ]>");
|
||||||
if ($__ie_ver == FALSE || $__ie_ver > 4) {
|
define('IE_END', "<![endif]-->");
|
||||||
// ADD COND COMMENTS
|
} else {
|
||||||
define('IE_START', "<!--[if lt IE 8 ]>");
|
// IE4 DETECTED, DO NOT ADD COMMENTS
|
||||||
define('IE_END', "<![endif]-->");
|
define('IE_START', '');
|
||||||
} else {
|
define('IE_END', '');
|
||||||
// IE4 DETECTED, DO NOT ADD COMMENTS
|
}
|
||||||
define('IE_START', '');
|
|
||||||
define('IE_END', '');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ie(string $inner) {
|
function ie(string $inner) {
|
||||||
|
@ -23,7 +26,7 @@ function ie(string $inner) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function ie_ua(string $inner, int $ver) {
|
function ie_ua(string $inner, int $ver) {
|
||||||
if ($GLOBALS['__ie_ver'] == $ver)
|
if (IE_VERSION == $ver)
|
||||||
return $inner;
|
return $inner;
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue