[BUGFIX] Set semantic value to autocomplete 13/47813/6
authorNicole Cordes <typo3@cordes.co>
Wed, 20 Apr 2016 14:05:24 +0000 (16:05 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Fri, 29 Apr 2016 17:47:39 +0000 (19:47 +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/47813
Reviewed-by: Markus Sommer <markussom@posteo.de>
Tested-by: Markus Sommer <markussom@posteo.de>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
typo3/sysext/backend/Classes/Form/Element/InputColorPickerElement.php
typo3/sysext/backend/Classes/Form/Element/InputTextElement.php
typo3/sysext/rsaauth/Classes/Form/Element/RsaInputElement.php

index 5890275..3e80c9c 100644 (file)
@@ -120,7 +120,7 @@ class InputColorPickerElement 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 55b21c9..3215d77 100644 (file)
@@ -150,7 +150,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 2d1ca13..2fead67 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