]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't use placeholder for password in IE8 & 9
authorMorris Jobke <hey@morrisjobke.de>
Mon, 16 Mar 2015 12:11:44 +0000 (13:11 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 26 Mar 2015 19:03:27 +0000 (20:03 +0100)
* the placeholder is in IE 8 and 9 just set as text and
  styled a bit grey. If the form is then serialized without
  typing something in the placeholder is sent as value
* this fixes that behaviour for the password field and
  properly detects empyt passwords
* fixes #14912

settings/js/personal.js

index e2fb6f025f11299144d8a80318671d5aab7b4861..302906702bd21aef70b6d3590ecda39330892d49 100644 (file)
@@ -172,7 +172,13 @@ $(document).ready(function () {
                $('#pass2').showPassword().keyup();
        }
        $("#passwordbutton").click(function () {
-               if ($('#pass1').val() !== '' && $('#pass2').val() !== '') {
+               var isIE8or9 = html.hasClass('lte9');
+               // FIXME - TODO - once support for IE8 and IE9 is dropped
+               // for IE8 and IE9 this will check additionally if the typed in password
+               // is different from the placeholder, because in IE8/9 the placeholder
+               // is simply set as the value to look like a placeholder
+               if ($('#pass1').val() !== '' && $('#pass2').val() !== ''
+                       && !(isIE8or9 && $('#pass2').val() === $('#pass2').attr('placeholder'))) {
                        // Serialize the data
                        var post = $("#passwordform").serialize();
                        $('#passwordchanged').hide();