|
|
|
@ -503,18 +503,18 @@ public class Network {
|
|
|
|
|
final int lastSemicolon = userAgent.lastIndexOf(';');
|
|
|
|
|
final int firstClosedParenthesis = userAgent.indexOf(')');
|
|
|
|
|
|
|
|
|
|
if(lastSemicolon > 0) {
|
|
|
|
|
// ; Location)
|
|
|
|
|
location = (firstClosedParenthesis > 0) ? userAgent.substring(lastSemicolon, firstClosedParenthesis).trim()
|
|
|
|
|
: userAgent.substring(lastSemicolon + 1).trim();
|
|
|
|
|
if (lastSemicolon > 0) {
|
|
|
|
|
// ; Location )
|
|
|
|
|
location = (firstClosedParenthesis > 0) ? userAgent.substring(lastSemicolon + 1, firstClosedParenthesis)
|
|
|
|
|
.trim() : userAgent.substring(lastSemicolon + 1).trim();
|
|
|
|
|
} else {
|
|
|
|
|
if(firstOpenParenthesis > 0) {
|
|
|
|
|
if(firstClosedParenthesis > 0) {
|
|
|
|
|
// (Location)
|
|
|
|
|
location = userAgent.substring(firstOpenParenthesis, firstClosedParenthesis).trim();
|
|
|
|
|
if (firstOpenParenthesis > 0) {
|
|
|
|
|
if (firstClosedParenthesis > 0) {
|
|
|
|
|
// ( Location )
|
|
|
|
|
location = userAgent.substring(firstOpenParenthesis + 1, firstClosedParenthesis).trim();
|
|
|
|
|
} else {
|
|
|
|
|
// ( Location <end>
|
|
|
|
|
location = userAgent.substring(firstOpenParenthesis).trim();
|
|
|
|
|
location = userAgent.substring(firstOpenParenthesis + 1).trim();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
location = "";
|
|
|
|
|