MantisBT - TestLink
View Issue Details
0008757TestLinkAPI - XMLRPCpublic2019-09-05 14:492019-09-06 08:27
multicode 
fman 
normalmajoralways
resolvedfixed 
1.9.18 (2018 Q3) 
1.9.20 Raijing DEV 
Postgres
READY FOR TESTING
0008757: API - XMLRPC -Unable to update test case name with long UTF-8 string
It's possible to create test case in TestLink with name like "???????? ??????? ???????? ????-????? ?? ??????? ?????, ??????? ????? ?????? ? TestLink ??? ??????".
But when we try to update the test case name with the same string using the updateTestCase method, we get the error "LOCALIZE: API_TESTCASE_NAME_LEN_EXCEEDED".
1. Create test case.
2. Try to update the test case name with the string "???????? ??????? ???????? ????-????? ?? ??????? ?????,
??????? ????? ?????? ? TestLink ??? ??????" using updateTestCase API-XMLRPC method.
Problem solved as follows:
"strlen" should be replaced by "mb_strlen" in updateName function in /lib/functions/testcase.class.php file:
if( ($nl = strlen($new_name)) <= 0 ) --> if( ($nl = mb_strlen($new_name)) <= 0 )

The same problem should be in 1.9.19 version.
No tags attached.
child of 0008549assigned fman Availables hot-fixes for 1.9.19 & How To get full fixed package from GitHub 
Issue History
2019-09-05 14:49multicodeNew Issue
2019-09-05 15:02fmanNote Added: 0029133
2019-09-05 17:38fmanQA Team - Task Workflow Status => TBD
2019-09-05 17:38fmanSummaryUnable to update test case name with long UTF-8 string => API - XMLRPC -Unable to update test case name with long UTF-8 string
2019-09-05 17:40fmanNote Added: 0029134
2019-09-05 17:43fmanQA Team - Task Workflow StatusTBD => READY FOR TESTING
2019-09-05 17:43fmanNote Added: 0029135
2019-09-05 17:43fmanStatusnew => resolved
2019-09-05 17:43fmanFixed in Version => 1.9.20 Raijing DEV
2019-09-05 17:43fmanResolutionopen => fixed
2019-09-05 17:43fmanAssigned To => fman
2019-09-05 17:43fmanRelationship addedchild of 0008549
2019-09-06 08:27multicodeNote Added: 0029136

Notes
(0029133)
fman   
2019-09-05 15:02   
Thanks, going to check
(0029134)
fman   
2019-09-05 17:40   
Root Cause is that when using XML-RPC API the method updateName() from testcase.class.php is used, and in this method length is checked.

It seems that when using the GUI, we trust in the length checks done on input.
(0029135)
fman   
2019-09-05 17:43   
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/54170449bbc61af2847518264cb7a2591dd749a4 [^]
(0029136)
multicode   
2019-09-06 08:27   
Thanks!