#297 A long Thai string cannot be saved as name

Major
closed
None
1
2016-05-18
2014-03-07
v21
No

At edit_entry, I fill this string "กากากากาxกากากากากากากากากากากากา" in name box and then the system denied to save the entry.

I found that it was because edit_entry_handler.php use substr that is not unaware of UTF-8 string.

I used MRBS 1.4.10.

Discussion

  • Campbell Morrison

    This problem has already been fixed in the trunk (Rev 2766, 18 Oct 2013). You can easily patch your system by changing line 316 of edit_entry_handler.php from

    $name = substr($name, 0, $maxlength['entry.name']);
    

    to

    $name = utf8_substr($name, 0, $maxlength['entry.name']);
    

    Campbell

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2015-02-20

    เพิ่มจำนวน ตัวรับค่าที่ ฟิว mysql ให้สามารถรับค่าได้มากขึ้น ก้จะรับได้มากขึ้นครับ

     
  • Campbell Morrison

    This problem is fixed in MRBS 1.4.11. However note that in 1.4.11 the name will be truncated. If you want to be able to store longer strings you will need to increase the length of the var_char in the entry and repeat tables and increase the length of $maxlength['entry.name'] in your config file.

    You can patch your 1.4.10 system by editing edit_entry_handler.php and changing substr() to utf8_substr()

     
    Last edit: Campbell Morrison 2015-02-25
  • Campbell Morrison

    I have just committed (Rev 3004) a change to the trunk which means that it's no longer necessary to set the $maxlength config variable as the maximum field lengths are now calculated automatically.

     
  • John Beranek

    John Beranek - 2016-05-18
    • status: open --> closed
    • assigned_to: Campbell Morrison
     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks