Strip whitespace and newlines from access token and style URL
Just in case browser weirdness or a tendency to triple-click-select is causing some cases of #2012.
This commit is contained in:
@@ -60,6 +60,8 @@
|
||||
}
|
||||
|
||||
+ (void) setAccessToken:(NSString *) accessToken {
|
||||
accessToken = [accessToken stringByTrimmingCharactersInSet:
|
||||
[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
if ( ! [accessToken length]) return;
|
||||
|
||||
[MGLAccountManager sharedManager].accessToken = accessToken;
|
||||
|
||||
@@ -3303,6 +3303,8 @@ class MBGLView : public mbgl::View
|
||||
|
||||
- (void)setStyleURL__:(nullable NSString *)URLString
|
||||
{
|
||||
URLString = [URLString stringByTrimmingCharactersInSet:
|
||||
[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
NSURL *url = URLString.length ? [NSURL URLWithString:URLString] : nil;
|
||||
if (URLString.length && !url)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user