mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
differenciate in our serverside user-agent detection between Chrome and Safari, and disable html5 form validation for float, as Chrome 12 rejects float values with comma as decimal separator
This commit is contained in:
parent
8d9003fbf8
commit
4f60da9af5
@ -1243,6 +1243,11 @@ class etemplate extends boetemplate
|
||||
// a few html5 options
|
||||
if ((string)$min !== '') $options .= ' min="'.htmlspecialchars($min).'"';
|
||||
if ((string)$max !== '') $options .= ' max="'.htmlspecialchars($max).'"';
|
||||
// disable html5 form validation for float, as Chrome 12 rejects float values with comma as decimal separator
|
||||
if ($type == 'float' && !$readonly && html::$user_agent == 'chrome' && strpos(self::$form_options,'novalidate') === false)
|
||||
{
|
||||
self::$form_options .= ' novalidate="novalidate"';
|
||||
}
|
||||
if ($cell_options == '' && !$readonly)
|
||||
{
|
||||
$cell_options = $cell['type'] == 'int' ? 5 : 8;
|
||||
|
@ -20,7 +20,7 @@
|
||||
class html
|
||||
{
|
||||
/**
|
||||
* user-agent: 'firefox', 'msie', 'safari' (incl. iPhone, Chrome), 'opera', 'konqueror', 'mozilla'
|
||||
* user-agent: 'firefox', 'msie', 'safari' (incl. iPhone), 'chrome', 'opera', 'konqueror', 'mozilla'
|
||||
* @var string
|
||||
*/
|
||||
static $user_agent;
|
||||
@ -65,7 +65,7 @@ class html
|
||||
if(!preg_match('/compatible; ([a-z]+)[\/ ]+([0-9.]+)/i',$_SERVER['HTTP_USER_AGENT'],$parts))
|
||||
{
|
||||
preg_match_all('/([a-z]+)\/([0-9.]+)/i',$_SERVER['HTTP_USER_AGENT'],$parts,PREG_SET_ORDER);
|
||||
$parts = array_pop($parts);
|
||||
$parts = $parts[2][1] == 'Chrome' ? $parts[2] : array_pop($parts);
|
||||
}
|
||||
list(,self::$user_agent,self::$ua_version) = $parts;
|
||||
if ((self::$user_agent = strtolower(self::$user_agent)) == 'version') self::$user_agent = 'opera';
|
||||
|
Loading…
Reference in New Issue
Block a user