[AC-845] Strings.format crashes on iOS
GitHub Issue | n/a |
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2015-09-30T02:50:39.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | ios |
Reporter | grebulon |
Assignee | Shak Hossain |
Created | 2015-05-06T08:11:23.000+0000 |
Updated | 2016-03-08T07:37:08.000+0000 |
Description
The following statement crashes on iPhone:
String.format(" & %1$s more...", "a, b, c", 5);
*Notes*
I'm passing an integer as a string argument (%s)
This doesn't raise a runtime error, it crashes out of the app straight to the launcher
This may be a *security problem*. I don't have time to attempt an exploit, but I have a feeling that there is one...
This works perfectly on Android
C-style printf is not appropriate for Javascript. You should replace this with some sort of typeless template replacement.
Replacing 5 with ""+5 results in "more..." being dropped:
String.format(" & %1$s more...", "a, b, c", ""+5);
results with
a, b, c & 5
Attachments
Hi , We have tested this issue and unable to reproduce it. We used the following test case. If you can provide us a test sample that reproduces the issue, we will investigate it further. Please find the screen sort.
Thanks