Hi,

I installed this module on D6.4. Everything has worked fine untill I found a strande bug today.
It is related with character number count in body text before the form is submitted.
I have a limit of 500 chars. When my body is not longer than approx 200-300 chars the ad is posted.

But if the number of chars around 400-450, after I submit the form the error is displayed saying that the number of chars is above 500, please limit the number to 500 or less. But I have less than 500 !

I looked for the answer in the forums but apparently this error is not typical. Can you help me please.

CommentFileSizeAuthor
#5 strlen_utf8-681586-5.patch1.07 KBSt4t0

Comments

Moscow’s picture

Some more info: once I input the text the couner shows actual number of chars. Then I hit SUBMIT, after the server returns the page the number of chars always 391. I tried to input 385, 455, 470 chars - after submitting it shows 391 below the text field.
Strange. I see it on localhost also.

I found another fact:
When I input latin chars - it works fine with 495 chars or so.
Once I substitute a dozen of latin chars out of 495 with cyrillic the error appears and the above described symptoms also appears.

It looks this line is responsible for calculating chars number on the server.
$current_body_length = strlen(trim($node->body));
I do not see why it should behave buggy with cyrillic.
Any ideas?

Moscow’s picture

Can anyone share his knowlede abt it?

Moscow’s picture

Tried everything, all in vain. Is there anybody out there?

pvasener’s picture

Subscribing

St4t0’s picture

Status: Active » Needs review
StatusFileSize
new1.07 KB

Bug confirmed in 6.x-2.0-alpha6. Use of strlen() instead of drupal_strlen() which returns number of bytes instead of number of characters.

Patch fixes this

Already fixed in 6.x-3.0-beta1.

fgm’s picture

Status: Needs review » Reviewed & tested by the community

Problem confirmed and patch fixes it.

fgm’s picture

Version: 6.x-2.0-alpha6 » 6.x-2.x-dev
Status: Reviewed & tested by the community » Fixed

Already committed 6.x-2.x as part of the #777472: Coding standard cleanup fix.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.