Conflict with unrecognised user agent strings

openglobal
12 years, 4 months ago
I've been using Mobile Joomla and Akeeba backup for some time, but today there has suddenly started to be a conflict between them.

I have a perl script that uses LWP::UserAgent to call:

www.example.com/index.php?option=com_akeeba&view=backup&key=#######&profile=1&format=raw

(where ####### is the password).

This is used to automate backups without having to manually log into the backend of the website and has been working fine for months. But today it failed because it's trying to redirect to one of the mobile subdomains instead.

The perl script uses the user agent string of "OpenGlobal". By changing this to "Mozilla/5.0 (X11; Linux i686; rv:10.0.1) Gecko/20100101 Firefox/10.0.1", it magically started working again.

How are unrecognised UA strings handled? It seems like unrecognised UA strings default to the first mobile subdomain.

OpenGlobal
openglobal
12 years, 4 months ago
I've just noticed that this is also affecting the W3C validator. Whenever I try to run my site through the validator, it gets redirected to the mobile site.

If you try running www.openglobal.co.uk through the validator at validator.w3.org, it gets redirected to mobile.openglobal.co.uk and tries to validate that instead.

This is looking like quite a major bug now.

OpenGlobal
dryabov
12 years, 3 months ago
It's because of User-Agent header is not included into AMDD database, it will be fixed in next MJ release.

You can validate www.openglobal.co.uk?device=desktop to avoid redirection.
openglobal
12 years, 3 months ago
Are you saying that MJ now works by positive ID of desktops rather than positive ID of mobiles now?

If that's the case, I'll be uninstalling! An unrecognised user agent is a "desktop", not a mobile.

OpenGlobal
dryabov
12 years, 3 months ago
 MJ initially use fast check for most popular desktop browsers (IE, Firefox, Chrome, Safari, Opera), and if only it's clear that visitor's browser is not belong to that group, MJ uses database (AMDD or Scientia) to find device type and capabilities using soft match method. W3C validator has User-Agent header "W3C_Validator/1.3", but the most closest entry in database is "W3C-mobileOK/DDC-1.0" (corresponding to W3C mobile validator). That's why W3C validator was detected as mobile device.

PS. MobileJoomla Pro with remote database detects W3C validator correctly, and AMDD database will be updated with next MJ release.
openglobal
12 years, 3 months ago
So what was matching the user agent "OpenGlobal" ?
dryabov
12 years, 3 months ago
As there is no "OpenGlobal" in the database, it uses most closest (in the term of levenshtein distance) entry in the database: "OptusD736" (old phone with small 90x35px screen).

PS. I've never met "OpenGlobal" user agent in access logs, usually perl uses strings like "libwww-perl-5.160".
openglobal
12 years, 3 months ago
dryabov wrote:
I've never met "OpenGlobal" user agent in access logs, usually perl uses strings like "libwww-perl-5.160".


Exactly, it's completely made up, so it should default to "desktop", not mobile. "OpenGlobal" is completely different to "OptusD736" so it should not just assume it's a mobile. Two letters the same is not a close enough match, it must default to "desktop".

Why has this changed?

OpenGlobal
dryabov
12 years, 3 months ago
Current algorithm allows to change (add/delete/replace) up to 12 characters to match.

Anyway, thanks for report, we are going to update current algorithm in next MJ release to be more smart in the case of short user-agent strings.
openglobal
12 years, 3 months ago
Is this a setting in the config? I can't find anything like that. That would probably be the best option for all users. Personally I'd want the most specific match (12+), but other users may want to default to mobile so 2 or 3 would be fine.

OpenGlobal
1

By continuing to use this site you consent to the use of cookies on your device as described in our cookie policy unless you have disabled them. This site will not function correctly without cookies.

I accept cookies from this site.