As the FTP site is not working I cloned the git branch for 7.x-1.x so not sure if I'm using the dev or beta code.

I have found that the php code counts the newlines more than once.

I've attached screen shots of this happening. You can see that the javascript is counting correctly (not all text is shown though) and the php after submitting the page says that it is over the limit by 2 characters.

Comments

jm.federico’s picture

Hi, thanks for your report.

The PHP validations is actually not performed by this module. it comes bundled with Drupal Core, what we might do is just count them twice too in the JS.

Just to be sure, can you please confirm if there is an extra line-break at the end of the second paragraph?

jm.federico’s picture

Priority: Major » Normal

Downgrading to normal since it will actually still work, only that it is a bit of an annoyance.

Nalum’s picture

Hello, no problem.

There is no line-break at the end of the second paragraph.

dave reid’s picture

Probably because new lines are actually two characters in PHP: \r\n.

This is because browsers submit new lines in forms as two characters: \r\n.

dave reid’s picture

Title: Maxlength Count » PHP strlen() does not match JavaScripts .length if string has newlines
Status: Active » Needs review
StatusFileSize
new1.76 KB
bambilicious’s picture

Corrected mr.strlen -> ml.strlen.

jm.federico’s picture

Status: Needs review » Closed (won't fix)

Closing as module is not maintained any more.