PDA

View Full Version : Miscellaneous Hacks - IE11 browser detection and fixes


Zachery
10-16-2013, 10:00 PM
IE11 has some issues with vB5 as it stands now due to bad browser detection. These changes should address the issues at hand until the software is patched.

In core/includes/functions.php find:





// detect macintosh



Add above:



// Detect Modern IE11+

if (strpos($useragent, 'trident') !== false AND !$is['opera'] AND !$is['ie'])

{

preg_match('#rv:([0-9\.-]+)#', $useragent, $regs);

$is['ie'] = $regs[1];



}





Next, find:



if (strpos($useragent, 'gecko') !== false AND !$is['safari'] AND !$is['konqueror'])



And replace it with



if (strpos($useragent, 'gecko') !== false AND !$is['safari'] AND !$is['konqueror'] AND !$is['ie'])


Next, we have one more change to make:

In /includes/vb5/frontend/controller.php Find


if (isset($_SERVER['HTTP_USER_AGENT']) &&
(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
{
header('Content-type: text/plain; charset=UTF-8');
}

Add after


// IE11+ detection, MS changed the UA
elseif (isset($_SERVER['HTTP_USER_AGENT']) &&
(strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false))
{

header('Content-type: text/plain; charset=UTF-8');
}

Afrika
11-13-2013, 03:21 PM
Done, but in opera it does'nt work

Zachery
11-13-2013, 05:15 PM
It wasn't intended to fix opera, but I might be able to spare some time to look into it.

Afrika
11-16-2013, 10:29 PM
great :D Thanks

Zachery
11-20-2013, 07:27 PM
Made a small change to fix a IE10 detection issue.

IggyP
11-28-2013, 09:36 AM
thanks for posting zachery:)

one note tho the first file is rather large so for reference its looking 3/4 down or so line 7200something or such i forget exact but in that area