breautek commented on code in PR #168:
URL:
https://github.com/apache/cordova-plugin-device/pull/168#discussion_r916751443
##########
src/ios/CDVDevice.m:
##########
@@ -86,10 +86,14 @@ - (void)getDeviceInfo:(CDVInvokedUrlCommand*)command
- (NSDictionary*)deviceProperties
{
UIDevice* device = [UIDevice currentDevice];
+ //strip non-alphanumeric from device name
+ NSCharacterSet *charactersToRemove = [[NSCharacterSet
alphanumericCharacterSet] invertedSet];
+ NSString *deviceName = [[[device name]
componentsSeparatedByCharactersInSet:charactersToRemove]
componentsJoinedByString:@""];
Review Comment:
Apple's documentation for
[UIDevice->name](https://developer.apple.com/documentation/uikit/uidevice/1620015-name?language=objc)
states
> The value of this property is an arbitrary alphanumeric string that is
associated with the device as an identifier. For example, you can find the name
of an iOS device in the General > About settings.
So is scanning for non-alphanumeric characters really necessarily? Apple
specifically states it's an alphanumeric string.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]