Merged in jennydmz/processmaker/PM-483_master (pull request #1015)

PM-483 Fixing and reusing the getBrowser method in G class.
This commit is contained in:
Julio Cesar Laura Avendaño
2014-10-22 10:33:07 -04:00

View File

@@ -5534,31 +5534,6 @@ class G
}
/**
* Get the actual browser.
*/
public function getActualBrowser ()
{
$browser=array("TRIDENT","IE","OPERA","MOZILLA","NETSCAPE","FIREFOX","SAFARI","CHROME");
$info['browser'] = "OTHER";
foreach ($browser as $parent) {
if( $parent == 'TRIDENT') {
$parent = "RV";
}
$s = strpos(strtoupper($_SERVER['HTTP_USER_AGENT']), $parent);
$f = $s + strlen($parent);
$version = substr($_SERVER['HTTP_USER_AGENT'], $f, 15);
$version = preg_replace('/[^0-9,.]/','',$version);
if ($s) {
$info['browser'] = $parent;
$info['version'] = $version;
}
}
$info['browser'] = ($info['browser']=='RV')? 'IE':$info['browser'];
return $info;
}
/*
* Check the browser compativility
*/
public function checkBrowserCompatibility($browser = null, $version = null)