From 91fa9127472e40c9c5e02091ed0ca4edd482975f Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Wed, 18 Oct 2006 11:43:27 +0000
Subject: [PATCH] - Patch #80749 by wdp: don't generate empty attributes.

---
 includes/form.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/includes/form.inc b/includes/form.inc
index 8f28d303e079..d0a72c9b9c2a 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -1348,9 +1348,10 @@ function theme_markup($element) {
 */
 function theme_password($element) {
   $size = $element['#size'] ? ' size="'. $element['#size'] .'" ' : '';
+  $maxlength = $element['#maxlength'] ? ' maxlength="'. $element['#maxlength'] .'" ' : '';
 
   _form_set_class($element, array('form-text'));
-  $output = '<input type="password" maxlength="'. $element['#maxlength'] .'" name="'. $element['#name'] .'" id="'. $element['#id'] .'" '. $size . drupal_attributes($element['#attributes']) .' />';
+  $output = '<input type="password" name="'. $element['#name'] .'" id="'. $element['#id'] .'" '. $maxlength . $size . drupal_attributes($element['#attributes']) .' />';
   return theme('form_element', $element, $output);
 }
 
-- 
GitLab