Problem/Motivation

When submitting the form, fields using maxlength are sometimes not validated because maxlength_validate_input() is wrong : it's counting every letter from HTML entities.

This is not duplicated from http://drupal.org/node/1830182 which is only about maxlength.js.

Proposed resolution

Add the following cleanup to maxlength_validate_input():

$value = preg_replace('/&(?:[a-z\d]+|#\d+|#x[a-f\d]+);/i', 'X', $value);

Comments

cedewey’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

We are only maintaining the Drupal 7 version of the module for critical security fixes, so I'm marking this Closed (won't fix). Thank you for working on this issue. If you do want to maintain the Drupal 7 version, do reach out. We'd be happy to bring you on board as a maintainer.

I also encourage you, if you haven't already, to upgrade your site to Drupal 8/9. We are actively maintaining that version and you would enjoy all of the other features of the latest version of Drupal.