Last modified: 2011-05-23 13:02:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T28807, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26807 - Mobile server resolves {{SERVER}} and {{SERVERNAME}} incorrectly
Mobile server resolves {{SERVER}} and {{SERVERNAME}} incorrectly
Status: RESOLVED FIXED
Product: Wikimedia Mobile
Classification: Unclassified
Retired (Ruby) Gateway (Other open bugs)
.5
All All
: Normal normal (vote)
: ---
Assigned To: Hampton Catlin
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-19 18:06 UTC by Snottywong
Modified: 2011-05-23 13:02 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Snottywong 2011-01-19 18:06:24 UTC
When viewing a wikipedia article from the http://en.m.wikipedia.org/ server, the magic words {{SERVER}} and {{SERVERNAME}} both resolve to "http://en.wikipedia.org".  The impact is that we have no way of testing whether the user is on the mobile site, and therefore no way of hiding/showing elements which don't display correctly on mobile phones, or which aren't appropriate for mobile users.  We also have no way of creating elements which display differently on the mobile site than they do on the regular site.

Expected behavior: {{SERVER}} and {{SERVERNAME}} should resolve to "http://en.m.wikipedia.org/" when a page is being viewed via the mobile server.
Comment 1 Mark A. Hershberger 2011-01-20 23:58:16 UTC
I'm don't know enough to say for sure, so:

Hampton is this fixed in the mobile code or should it be in MW itself?
Comment 2 Hampton Catlin 2011-01-21 00:20:36 UTC
I am not really familiar with what those mean at all.....

I'm not sure what the bug is..
Comment 3 Brion Vibber 2011-01-21 00:47:19 UTC
The mobile interface is a proxy application which lets MediaWiki render basic page text, then modifies it to optimize for small screens and puts it in a mobile-specific user interface. Wiki pages have no way of "knowing" inherently that they're being viewed in another way; modifying the styles (and sometimes markup) is the mobile proxy's job.


{{SERVER}} and {{SERVERNAME}} are keywords in wiki syntax which return the wiki's hostname (in the former case including the protocol prefix). They are sometimes used by templates to generate arbitrary links to something on the site, which isn't always a super safe practice but can be handy.

If constructing an arbitrary link in a wiki page, doing it with the canonical URLs is probably the right thing to do -- you don't know that the mobile proxy will have such a link at its domain.
Comment 4 Brion Vibber 2011-01-21 00:49:17 UTC
What I'd recommend is that there be documented ways to mark sections of a page as to be hidden for mobile or marking that something can be optimized in a particular way. CSS classes are probably good for this.
Comment 5 Hampton Catlin 2011-01-21 13:27:53 UTC
Anything marked with 

.noprint
div.messagebox
.hiddenStructure

is automatically stripped out.
Comment 6 Mark A. Hershberger 2011-01-22 01:05:29 UTC
would it make sense to add ".nomobile" to the list?
Comment 7 Hampton Catlin 2011-05-23 13:02:41 UTC
.nomobile has been added to the list of things automatically removed.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links