[BUGFIX] Set semantic value to autocomplete 73/47973/2
authorNicole Cordes <typo3@cordes.co>
Wed, 20 Apr 2016 14:05:24 +0000 (16:05 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sat, 30 Apr 2016 01:09:49 +0000 (03:09 +0200)
To enforce Chrome to respect the disabled autocompletion for fields,
the value of the autocomplete attribute is set to some semantic
value.

Resolves: #75809
Releases: master, 7.6
Change-Id: Ib30fdfe7d7a9ff3f564b8e016331a0706ff0db01
Reviewed-on: https://review.typo3.org/47973
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
typo3/sysext/backend/Classes/Form/Element/InputTextElement.php
typo3/sysext/rsaauth/Classes/Form/Element/RsaInputElement.php

index e57845b..fce7161 100644 (file)
@@ -172,7 +172,7 @@ class InputTextElement extends AbstractFormElement
         }
 
         if (isset($config['autocomplete'])) {
-            $attributes['autocomplete'] = empty($config['autocomplete']) ? 'off' : 'on';
+            $attributes['autocomplete'] = empty($config['autocomplete']) ? 'new-' . $fieldName : 'on';
         }
 
         // Build the attribute string
index c697dca..89d8239 100644 (file)
@@ -71,7 +71,7 @@ class RsaInputElement extends AbstractFormElement
                 case 'password':
                     $attributes['type'] = 'password';
                     $attributes['value'] = '********';
-                    $attributes['autocomplete'] = 'off';
+                    $attributes['autocomplete'] = 'new-' . $fieldName;
                     break;
                 default:
                     // @todo: This is ugly: The code should find out on it's own whether a eval definition is a
@@ -125,7 +125,7 @@ class RsaInputElement extends AbstractFormElement
         }
 
         if (isset($config['autocomplete'])) {
-            $attributes['autocomplete'] = empty($config['autocomplete']) ? 'off' : 'on';
+            $attributes['autocomplete'] = empty($config['autocomplete']) ? 'new-' . $fieldName : 'on';
         }
 
         // Build the attribute string